package com.wing.bill.service;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wing.bill.controller.admin.ReportUtil;
import com.wing.bill.dao.CabinetFormDao;
import com.wing.cabinet.model.entity.CellInventoryInout;
import com.wing.cabinet.model.entity.CellSluggishMaterials;
import com.wing.cabinet.model.entity.CheckedResult;
import com.wing.cabinet.model.entity.StorageInventoryInout;
import com.wing.cabinet.model.response.*;
import com.wing.cabinet.service.*;
import com.wing.cabinet.utils.FindDateStatusUtil;
import com.wing.common.utils.JsonResult;
import com.wing.common.utils.LocalDateTimeUtils;
import com.wing.common.utils.PageResult;
import com.wing.product.model.entity.ProductCategory;
import com.wing.product.model.entity.ProductDetail;
import com.wing.product.model.response.ProductTypeVO;
import com.wing.product.service.ProductDetailService;
import com.wing.product.service.ProductTypeService;
import com.wing.web.utils.JwtUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
import java.time.temporal.TemporalAdjusters;
import java.util.*;

@Service
public class CabinetFormServiceImpl implements CabinetFormService{
    @Autowired
    private CabinetFormDao cabinetFormDao;
    @Autowired
    private CellInventoryInoutService cellInventoryInoutService;
    @Autowired
    private StorageInventoryInoutService storageInventoryInoutService;
    @Autowired
    private CheckedResultService checkedResultService;
    @Autowired
    private CellInventorySpaceService cellInventorySpaceService;
    @Autowired
    private StorageInventorySpaceService storageInventorySpaceService;
    @Autowired
    private UseInventoryUserService useInventoryUserService;
    @Autowired
    private CellSingleInventoryProductService cellSingleInventoryProductService;
    @Autowired
    private BrandLifeService brandLifeService;
    @Autowired
    private  CellInventoryProductService cellInventoryProductService;
    @Autowired
    private ProductDetailService productDetailService;
    @Autowired
    private ProductTypeService productTypeService;

    LocalDateTime startWeekDateTime = null;
    LocalDateTime endWeekDateTime = null;
    LocalDateTime startMonthDateTime = null;
    LocalDateTime endMonthDateTime = null;

    /**
     * 根据类型获取不同时间
     * @param dateType
     */
    public void dateTimeByDateType(String dateType){

        if (dateType.equals("before")){//往前推一周/一月
            startWeekDateTime = ReportUtil.weekUtil().get(0);
            endWeekDateTime = ReportUtil.weekUtil().get(1);

            startMonthDateTime = ReportUtil.dateUtil().get(0);
            endMonthDateTime = ReportUtil.dateUtil().get(1);
        } else if (dateType.equals("current")) {//当周、当月
            startWeekDateTime = ReportUtil.thisWeekUtil().get(0);
            endWeekDateTime = ReportUtil.thisWeekUtil().get(1);

            startMonthDateTime = ReportUtil.monthUtil().get(0);
            endMonthDateTime = ReportUtil.monthUtil().get(1);
        }
    }


    @Override
    public JsonResult list1(String type, String startTime, String endTime, int click, String code, String mainCabCode) {//领新选项卡
        if (StringUtils.isNotBlank(type)&&click==0){//顶部数据  固定时间
                HashMap map1 = new HashMap(){{put("title","领新数量(支)");put("sign","10");}};
                HashMap map2 = new HashMap(){{put("title","售刀柜在库刀具数量(支)");put("sign","14");}};
                HashMap map3 = new HashMap(){{put("title","库存警告数(条)");put("sign","1");}};
                //HashMap map4 = new HashMap(){{put("title","待盘验任务数(个)");put("sign","7");}};
                HashMap map5 = new HashMap(){{put("title","领新金额(元)");put("sign","15");}};
                HashMap map6 = new HashMap(){{put("title","在库总价值(元)");put("sign","6");}};
                if (type.equals("0")){
                    map1.putAll(cabinetFormDao.queryNew(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//领新数量
                    //map3.putAll(cabinetFormDao.queryOtherList1(dayUtil().get(0),dayUtil().get(1),code));//告警数量
                    //map4.putAll(cabinetFormDao.queryCheck(dayUtil().get(0),dayUtil().get(1),code));//待盘验任务数量
                    map5.putAll(cabinetFormDao.queryNewAmount(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//领新金额
                }else if (type.equals("1")){
                    map1.putAll(cabinetFormDao.queryNew(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//领新数量
                    //map3.putAll(cabinetFormDao.queryOtherList1(weekUtil().get(0),weekUtil().get(1),code));//告警数量
                    //map4.putAll(cabinetFormDao.queryCheck(weekUtil().get(0),weekUtil().get(1),code));//待盘验任务数量
                    map5.putAll(cabinetFormDao.queryNewAmount(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//领新金额
                }else{
                    map1.putAll(cabinetFormDao.queryNew(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//领新数量
                    //map3.putAll(cabinetFormDao.queryOtherList1(dateUtil().get(0),dateUtil().get(1),code));//告警数量
                    //map4.putAll(cabinetFormDao.queryCheck(dateUtil().get(0),dateUtil().get(1),code));//待盘验任务数量
                    map5.putAll(cabinetFormDao.queryNewAmount(dateUtil().get(0),dateUtil().get(1),code,mainCabCode));//领新金额
                }
            map2.putAll(cabinetFormDao.queryExist(code,mainCabCode));//售刀柜在库刀具数量 不随时间变化
            map3.putAll(cabinetFormDao.queryOther(code,mainCabCode));//告警数量  不随时间变化
            map6.putAll(cabinetFormDao.queryExistAmount(code,mainCabCode));//售刀柜在库刀具总价值 不随时间变化
            List list = new ArrayList();
            list.add(map1);
            list.add(map2);
            list.add(map3);
            //list.add(map4);
            list.add(map5);
            list.add(map6);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==0){//顶部数据  指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            HashMap map1 = cabinetFormDao.queryNew(start,end,code, mainCabCode);;//领新数量
            map1.put("title","领新数量(支)");
            map1.put("sign","10");
            HashMap map2 = cabinetFormDao.queryExist(code, mainCabCode);//售刀柜在库刀具数量
            map2.put("title","售刀柜在库刀具数量(支)");
            map2.put("sign","14");
            HashMap map3 = cabinetFormDao.queryOther(code, mainCabCode);//告警数量
            map3.put("title","库存警告数(条)");
            map3.put("sign","1");
            /*HashMap map4 = cabinetFormDao.queryCheck(start,end,code);//待盘验任务数量
            map4.put("title","盘验任务数(个)");
            map4.put("sign","7");*/
            HashMap map5 = cabinetFormDao.queryNewAmount(start,end,code, mainCabCode);//领新金额
            map5.put("title","领新金额(元)");
            map5.put("sign","15");
            HashMap map6 = cabinetFormDao.queryExistAmount(code, mainCabCode);//在库刀具总价值
            map6.put("title","在库总价值(元)");
            map6.put("sign","6");
            List list = new ArrayList();
            list.add(map1);
            list.add(map2);
            list.add(map3);
            //list.add(map4);
            list.add(map5);
            list.add(map6);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(type)&&click==1){//领新数量点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.queryNewQuantityClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.queryNewQuantityClick(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.queryNewQuantityClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==2){//售刀柜在库刀具数量点击 固定时间
            return JsonResult.success("查询成功",cabinetFormDao.queryCellQuantityClick(code,mainCabCode));
        }
        if (StringUtils.isNotBlank(type)&&click==3){//库存告警数点击 固定时间
            return JsonResult.success("查询成功",cabinetFormDao.queryAlarmClick(code,mainCabCode));
        }
       /* if (StringUtils.isNotBlank(type)&&click==4){//盘验数点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.queryCheckClick(dayUtil().get(0),dayUtil().get(1),code));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.queryCheckClick(weekUtil().get(0),weekUtil().get(1),code));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.queryCheckClick(dateUtil().get(0),dateUtil().get(1),code));
            }
        }*/
        if (StringUtils.isNotBlank(type)&&click==4){//领新金额点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.queryNewAmountClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.queryNewAmountClick(weekUtil().get(0),weekUtil().get(1),code,mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.queryNewAmountClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==5){//售刀柜在库刀具总价值点击 固定时间
            return JsonResult.success("查询成功",cabinetFormDao.queryExistAmountClick(code,mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==1){//领新数量点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.queryNewQuantityClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==2){//售刀柜在库刀具数量点击 指定时间
            return JsonResult.success("查询成功",cabinetFormDao.queryCellQuantityClick(code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==3){//库存告警数点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.queryAlarmClick(code, mainCabCode));
        }
      /*  if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==4){//盘验数点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.queryCheckClick(start,end,code));
        }*/
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==4){//领新金额点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.queryNewAmountClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==5){//售刀柜在库刀具总价值点击 指定时间
            return JsonResult.success("查询成功",cabinetFormDao.queryExistAmountClick(code, mainCabCode));
        }
        return JsonResult.fail("查询失败");
    }

    @Override
    public JsonResult newFirstChart(String type, String startTime, String endTime, String other, String param, String code, String mainCabCode) {
        HashMap hm1 = new HashMap();
        hm1.put("title","刀具消耗情况(产品)");
        List<HashMap> list1 = new ArrayList<>();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            if(other.equals("oldSpec")){
                list1.addAll(cabinetFormDao.queryCabinetBySkuName(start,end,param,code, mainCabCode));//刀具消耗情况按刀具sku名称   修改为按原规格码  修改为物料规格
                hm1.put("avg",cabinetFormDao.queryCabinetBySkuNameAvg(start,end,param,code, mainCabCode));//平均值
            }else if(other.equals("type")){
                list1.addAll(cabinetFormDao.queryCabinetByTypeWeb(start,end,param,code, mainCabCode));//刀具消耗情况按类型 原型上是按工单 还没有工单 先用按类型
                hm1.put("avg",cabinetFormDao.queryCabinetByTypeAvg(start,end,param,code, mainCabCode));//平均值
            }else if(other.equals("category")){
                list1.addAll(cabinetFormDao.queryCabinetByCategory(start,end,param,code, mainCabCode));//刀具消耗情况按分类
                hm1.put("avg",cabinetFormDao.queryCabinetByCategoryAvg(start,end,param,code, mainCabCode));//平均值
            }else if(other.equals("brand")){
                list1.addAll(cabinetFormDao.queryCabinetByBrand(start,end,param,code, mainCabCode));//刀具消耗情况按品牌
                hm1.put("avg",cabinetFormDao.queryCabinetByBrandAvg(start,end,param,code, mainCabCode));//平均值
            }
        }
        if (type.equals("0")){
            if(other.equals("oldSpec")){
                list1.addAll(cabinetFormDao.queryCabinetBySkuName(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//刀具消耗情况按刀具sku名称   修改为按原规格码
                hm1.put("avg",cabinetFormDao.queryCabinetBySkuNameAvg(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("type")){
                list1.addAll(cabinetFormDao.queryCabinetByTypeWeb(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//刀具消耗情况按类型 原型上是按工单 还没有工单 先用按类型
                hm1.put("avg",cabinetFormDao.queryCabinetByTypeAvg(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("category")){
                list1.addAll(cabinetFormDao.queryCabinetByCategory(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//刀具消耗情况按分类
                hm1.put("avg",cabinetFormDao.queryCabinetByCategoryAvg(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("brand")){
                list1.addAll(cabinetFormDao.queryCabinetByBrand(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//刀具消耗情况按品牌
                hm1.put("avg",cabinetFormDao.queryCabinetByBrandAvg(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//平均值
            }
        }else if (type.equals("1")){
            if(other.equals("oldSpec")){
                list1.addAll(cabinetFormDao.queryCabinetBySkuName(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//刀具消耗情况按刀具sku名称   修改为按原规格码
                hm1.put("avg",cabinetFormDao.queryCabinetBySkuNameAvg(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("type")){
                list1.addAll(cabinetFormDao.queryCabinetByTypeWeb(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//刀具消耗情况按类型 原型上是按工单 还没有工单 先用按类型
                hm1.put("avg",cabinetFormDao.queryCabinetByTypeAvg(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("category")){
                list1.addAll(cabinetFormDao.queryCabinetByCategory(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//刀具消耗情况按分类
                hm1.put("avg",cabinetFormDao.queryCabinetByCategoryAvg(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("brand")){
                list1.addAll(cabinetFormDao.queryCabinetByBrand(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//刀具消耗情况按品牌
                hm1.put("avg",cabinetFormDao.queryCabinetByBrandAvg(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//平均值
            }
        }else if (type.equals("2")){
            if(other.equals("oldSpec")){
                list1.addAll(cabinetFormDao.queryCabinetBySkuName(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//刀具消耗情况按刀具sku名称   修改为按原规格码
                hm1.put("avg",cabinetFormDao.queryCabinetBySkuNameAvg(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("type")){
                list1.addAll(cabinetFormDao.queryCabinetByTypeWeb(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//刀具消耗情况按类型 原型上是按工单 还没有工单 先用按类型
                hm1.put("avg",cabinetFormDao.queryCabinetByTypeAvg(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("category")){
                list1.addAll(cabinetFormDao.queryCabinetByCategory(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//刀具消耗情况按分类
                hm1.put("avg",cabinetFormDao.queryCabinetByCategoryAvg(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("brand")){
                list1.addAll(cabinetFormDao.queryCabinetByBrand(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//刀具消耗情况按品牌
                hm1.put("avg",cabinetFormDao.queryCabinetByBrandAvg(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//平均值
            }
        }
        hm1.put("data",list1);
        return JsonResult.success("查询成功",hm1);
    }

    @Override
    public JsonResult newSecondChart(String type, String startTime, String endTime, String cabCode, String param, String code, String mainCabCode) {
        HashMap hm2 = new HashMap();
        hm2.put("title","刀具消耗情况(刀柜)");
        List<HashMap> list2 = new ArrayList<>();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            if (StringUtils.isNotBlank(cabCode)){
                list2.addAll(cabinetFormDao.queryCabinetBySpace(start,end,cabCode,param,code,mainCabCode));//一个柜子的货道
                hm2.put("avg",cabinetFormDao.queryCabinetBySpaceAvg(start,end,cabCode,param,code,mainCabCode));//平均值
            }else{
                list2.addAll(cabinetFormDao.queryCabinetByCab(start,end,param,code,mainCabCode));//所有柜子
                hm2.put("avg",cabinetFormDao.queryCabinetByCabAvg(start,end,param,code,mainCabCode));//平均值
            }
        }
        if (type.equals("0")){
            if (StringUtils.isNotBlank(cabCode)){
                list2.addAll(cabinetFormDao.queryCabinetBySpace(dayUtil().get(0),dayUtil().get(1),cabCode,param,code, mainCabCode));//一个柜子的货道
                hm2.put("avg",cabinetFormDao.queryCabinetBySpaceAvg(dayUtil().get(0),dayUtil().get(1),cabCode,param,code, mainCabCode));//平均值
            }else{
                list2.addAll(cabinetFormDao.queryCabinetByCab(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//所有柜子
                hm2.put("avg",cabinetFormDao.queryCabinetByCabAvg(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//平均值
            }
        }else if (type.equals("1")){
            if (StringUtils.isNotBlank(cabCode)){
                list2.addAll(cabinetFormDao.queryCabinetBySpace(weekUtil().get(0),weekUtil().get(1),cabCode,param,code, mainCabCode));//一个柜子的货道
                hm2.put("avg",cabinetFormDao.queryCabinetBySpaceAvg(weekUtil().get(0),weekUtil().get(1),cabCode,param,code, mainCabCode));//平均值
            }else{
                list2.addAll(cabinetFormDao.queryCabinetByCab(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//所有柜子
                hm2.put("avg",cabinetFormDao.queryCabinetByCabAvg(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//平均值
            }
        }else if (type.equals("2")){
            if (StringUtils.isNotBlank(cabCode)){
                list2.addAll(cabinetFormDao.queryCabinetBySpace(dateUtil().get(0),dateUtil().get(1),cabCode,param,code, mainCabCode));//一个柜子的货道
                hm2.put("avg",cabinetFormDao.queryCabinetBySpaceAvg(dateUtil().get(0),dateUtil().get(1),cabCode,param,code, mainCabCode));//平均值
            }else{
                list2.addAll(cabinetFormDao.queryCabinetByCab(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//所有柜子
                hm2.put("avg",cabinetFormDao.queryCabinetByCabAvg(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//平均值
            }
        }
        hm2.put("data",list2);
        return JsonResult.success("查询成功",hm2);
    }

    @Override
    public JsonResult newThirdChart(String type, String startTime, String endTime, String other, String param, String code, String mainCabCode) {
        HashMap hm3 = new HashMap();
        hm3.put("title","刀具消耗情况(按组织)");
        List list3 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            if(other.equals("person")){
                list3.addAll(cabinetFormDao.queryCabinetByNameWeb(start,end,param,code,mainCabCode));//刀具消耗情况按人员
                hm3.put("avg",cabinetFormDao.queryCabinetByNameAvg(start,end,param,code,mainCabCode));//平均值
            }else if(other.equals("device")){
                list3.addAll(cabinetFormDao.queryCabinetByMachineWeb(start,end,param,code,mainCabCode));//刀具消耗情况按使用该设备的机床
                hm3.put("avg",cabinetFormDao.queryCabinetByMachineAvg(start,end,param,code,mainCabCode));//平均值
            }else if(other.equals("dep")){
                list3.addAll(cabinetFormDao.queryCabinetByDep(start,end,param,code,mainCabCode));//刀具消耗情况按使用该设备的部门
                hm3.put("avg",cabinetFormDao.queryCabinetByDepAvg(start,end,param,code,mainCabCode));//平均值
            }
        }
        if (type.equals("0")){
            if(other.equals("person")){
                list3.addAll(cabinetFormDao.queryCabinetByNameWeb(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//刀具消耗情况按人员
                hm3.put("avg",cabinetFormDao.queryCabinetByNameAvg(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("device")){
                list3.addAll(cabinetFormDao.queryCabinetByMachineWeb(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//刀具消耗情况按使用该设备的机床
                hm3.put("avg",cabinetFormDao.queryCabinetByMachineAvg(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("dep")){
                list3.addAll(cabinetFormDao.queryCabinetByDep(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//刀具消耗情况按使用该设备的部门
                hm3.put("avg",cabinetFormDao.queryCabinetByDepAvg(dayUtil().get(0),dayUtil().get(1),param,code, mainCabCode));//平均值
            }
        }else if (type.equals("1")){
            if(other.equals("person")){
                list3.addAll(cabinetFormDao.queryCabinetByNameWeb(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//刀具消耗情况按人员
                hm3.put("avg",cabinetFormDao.queryCabinetByNameAvg(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("device")){
                list3.addAll(cabinetFormDao.queryCabinetByMachineWeb(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//刀具消耗情况按使用该设备的机床
                hm3.put("avg",cabinetFormDao.queryCabinetByMachineAvg(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("dep")){
                list3.addAll(cabinetFormDao.queryCabinetByDep(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//刀具消耗情况按使用该设备的部门
                hm3.put("avg",cabinetFormDao.queryCabinetByDepAvg(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//平均值
            }
        }else if (type.equals("2")){
            if(other.equals("person")){
                list3.addAll(cabinetFormDao.queryCabinetByNameWeb(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//刀具消耗情况按人员
                hm3.put("avg",cabinetFormDao.queryCabinetByNameAvg(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("device")){
                list3.addAll(cabinetFormDao.queryCabinetByMachineWeb(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//刀具消耗情况按使用该设备的机床
                hm3.put("avg",cabinetFormDao.queryCabinetByMachineAvg(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//平均值
            }else if(other.equals("dep")){
                list3.addAll(cabinetFormDao.queryCabinetByDep(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//刀具消耗情况按使用该设备的部门
                hm3.put("avg",cabinetFormDao.queryCabinetByDepAvg(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//平均值
            }
        }
        hm3.put("data",list3);
        return JsonResult.success("查询成功",hm3);
    }

    @Override
    public JsonResult newFourthChart(String type, String startTime, String endTime, String param, String code, String mainCabCode) {
        HashMap hm4 = new HashMap();
        hm4.put("title","刀具消耗情况(按日期)");
        hm4.put("date","yes");
        List list4 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list4.addAll(cabinetFormDao.queryCabinetByDate(start,end,param,code,mainCabCode));
            hm4.put("avg",cabinetFormDao.queryCabinetByDateAvg(start,end,param,code,mainCabCode));//平均值
            }
        if (type.equals("0")){
            list4.addAll(cabinetFormDao.queryCabinetByDay(dayUtil().get(0),dayUtil().get(1),param,code,mainCabCode));
            hm4.put("avg",cabinetFormDao.queryCabinetByDayAvg(dayUtil().get(0),dayUtil().get(1),param,code,mainCabCode));//平均值
        }else if (type.equals("1")){
            list4.addAll(cabinetFormDao.queryCabinetByDate(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));
            hm4.put("avg",cabinetFormDao.queryCabinetByDateAvg(weekUtil().get(0),weekUtil().get(1),param,code, mainCabCode));//平均值
        }else if (type.equals("2")){
            list4.addAll(cabinetFormDao.queryCabinetByDate(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));
            hm4.put("avg",cabinetFormDao.queryCabinetByDateAvg(dateUtil().get(0),dateUtil().get(1),param,code, mainCabCode));//平均值
            }
        hm4.put("data",list4);
        return JsonResult.success("查询成功",hm4);
    }



    @Override
    public JsonResult list2(String type, String startTime, String endTime, int click, String code, String mainCabCode) {//存入选项卡
        if (StringUtils.isNotBlank(type)&&click==0){//顶部数据  固定时间
            HashMap map = new HashMap(){{put("title","暂存存入(产品数量/订单数)");put("unit1","支");put("unit2","个订单");put("sign","10");}};
            HashMap map1 = new HashMap(){{put("title","报修存入(产品数量/订单数)");put("unit1","支");put("unit2","个订单");put("sign","10");}};
            HashMap map2 = new HashMap(){{put("title","报废存入(产品数量/订单数)");put("unit1","支");put("unit2","个订单");put("sign","10");}};
            HashMap map3 = new HashMap(){{put("title","异常存入(产品数量/订单数)");put("unit1","支");put("unit2","个订单");put("sign","8");}};
            if (type.equals("0")){
                map.putAll(cabinetFormDao.inTopQueryStaging(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//暂存存入
                map1.putAll(cabinetFormDao.inTopQueryRepair(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//修磨存入
                map2.putAll(cabinetFormDao.inTopQueryRecycle(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//报废存入
                map3.putAll( cabinetFormDao.inTopQueryUnusual(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//异常存入
            }else if (type.equals("1")){
                map.putAll(cabinetFormDao.inTopQueryStaging(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//暂存存入
                map1.putAll(cabinetFormDao.inTopQueryRepair(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//修磨存入
                map2.putAll(cabinetFormDao.inTopQueryRecycle(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//报废存入
                map3.putAll( cabinetFormDao.inTopQueryUnusual(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//异常存入
            }else{
                map.putAll(cabinetFormDao.inTopQueryStaging(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//暂存存入
                map1.putAll(cabinetFormDao.inTopQueryRepair(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//修磨存入
                map2.putAll(cabinetFormDao.inTopQueryRecycle(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//报废存入
                map3.putAll( cabinetFormDao.inTopQueryUnusual(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//异常存入
            }
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==0){//顶部数据  指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            HashMap map = cabinetFormDao.inTopQueryStaging(start,end,code, mainCabCode);//暂存存入
            map.put("title","暂存存入(产品数量/订单数)");
            map.put("unit1","支");
            map.put("unit2","个订单");
            map.put("sign","10");
            HashMap map1 = cabinetFormDao.inTopQueryRepair(start,end,code, mainCabCode);//修磨存入
            map1.put("title","报修存入(产品数量/订单数)");
            map1.put("unit1","支");
            map1.put("unit2","个订单");
            map1.put("sign","10");
            HashMap map2 = cabinetFormDao.inTopQueryRecycle(start,end,code, mainCabCode);//报废存入
            map2.put("title","报废存入(产品数量/订单数)");
            map2.put("unit1","支");
            map2.put("unit2","个订单");
            map2.put("sign","10");
            HashMap map3 = cabinetFormDao.inTopQueryUnusual(start,end,code, mainCabCode);//异常存入
            map3.put("title","异常存入(产品数量/订单数)");
            map3.put("unit1","支");
            map3.put("unit2","个订单");
            map3.put("sign","8");
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(type)&&click==1){//暂存存入点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.inTopQueryStagingClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.inTopQueryStagingClick(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.inTopQueryStagingClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==2){//修磨存入点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.inTopQueryRepairClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.inTopQueryRepairClick(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.inTopQueryRepairClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==3){//报废存入点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.inTopQueryRecycleClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.inTopQueryRecycleClick(weekUtil().get(0),weekUtil().get(1),code,mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.inTopQueryRecycleClick(dateUtil().get(0),dateUtil().get(1),code,mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==4){//异常存入点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.inTopQueryUnusualClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.inTopQueryUnusualClick(weekUtil().get(0),weekUtil().get(1),code,mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.inTopQueryUnusualClick(dateUtil().get(0),dateUtil().get(1),code,mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==1){//暂存存入点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.inTopQueryStagingClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==2){//修磨存入点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.inTopQueryRepairClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==3){//报废存入点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.inTopQueryRecycleClick(start,end,code,mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==4){//异常存入点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.inTopQueryUnusualClick(start,end,code,mainCabCode));
        }
        return JsonResult.fail("查询失败");
    }

    @Override
    public JsonResult inFirstChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm1 = new HashMap();
        hm1.put("title","存入记录排名(按产品)");
        List list1 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list1.addAll(cabinetFormDao.inProductByProduct(start,end,code,mainCabCode));//暂存柜在库产品排名按产品
            hm1.put("sum",cabinetFormDao.inProductByProductTotal(start,end,code,mainCabCode));//总数量
        }
        if (type.equals("0")){
            list1.addAll(cabinetFormDao.inProductByProduct(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//存放记录排名按产品 老规格码
            hm1.put("sum",cabinetFormDao.inProductByProductTotal(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//总数量
        }else if(type.equals("1")){
            list1.addAll(cabinetFormDao.inProductByProduct(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//存放记录排名按产品 老规格码
            hm1.put("sum",cabinetFormDao.inProductByProductTotal(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//总数量
        }else if (type.equals("2")){
            list1.addAll(cabinetFormDao.inProductByProduct(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//存放记录排名按产品 老规格码
            hm1.put("sum",cabinetFormDao.inProductByProductTotal(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//总数量
        }
        hm1.put("data",list1);
        return  JsonResult.success("查询成功",hm1);
    }

    @Override
    public JsonResult inSecondChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm2 = new HashMap();
        hm2.put("title","存入记录排名(按产品类型)");
        List list2 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list2.addAll(cabinetFormDao.inProductByType(start,end,code,mainCabCode));//存放记录排名按类型
        }
        if (type.equals("0")){
            list2.addAll(cabinetFormDao.inProductByType(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//存放记录排名按类型
        }else if(type.equals("1")){
            list2.addAll( cabinetFormDao.inProductByType(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//存放记录排名按类型
        }else if (type.equals("2")){
            list2.addAll(cabinetFormDao.inProductByType(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//存放记录排名按类型
        }
        hm2.put("data",list2);
        return  JsonResult.success("查询成功",hm2);
    }

    @Override
    public JsonResult inThirdChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm3 = new HashMap();
        hm3.put("title","存入记录排名(按人员)");
        List list3 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list3.addAll(cabinetFormDao.inRankByCreatorName(start,end,code,mainCabCode));//人员存放记录排名按人员
        }
        if (type.equals("0")){
            list3.addAll(cabinetFormDao.inRankByCreatorName(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//存放记录排名按人员
        }else if(type.equals("1")){
            list3.addAll(cabinetFormDao.inRankByCreatorName(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//人员存放记录排名按人员
        }else if (type.equals("2")){
            list3.addAll(cabinetFormDao.inRankByCreatorName(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//人员存放记录排名按人员
        }
        hm3.put("data",list3);
        return  JsonResult.success("查询成功",hm3);
    }

    @Override
    public JsonResult list3(String type, String startTime, String endTime, int click, String code, String mainCabCode) {//取出选项卡
        if (StringUtils.isNotBlank(type)&&click==0){//顶部数据  固定时间
            HashMap map = new HashMap(){{put("title","取出数量(支)");put("sign","16");}};
            HashMap map1 = new HashMap(){{put("title","领用订单数(个)");put("sign","11");}};
            HashMap map2 = new HashMap(){{put("title","领用人数(人)");put("sign","4");}};
            HashMap map3 = new HashMap(){{put("title","领用sku数(支)");put("sign","16");}};
            HashMap map4 = new HashMap(){{put("title","领用机台数(台)");put("sign","3");}};
            if (type.equals("0")){
                map.putAll(cabinetFormDao.outTopQueryStagingNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//取出暂存状态刀具的数量
                map1.putAll(cabinetFormDao.outTopQueryOutOrderNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//领用订单数
                map2.putAll(cabinetFormDao.outTopQueryOutNameNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//领用人数
                map3.putAll(cabinetFormDao.outTopQueryOutSkuNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//领用sku数
                map4.putAll(cabinetFormDao.outTopQueryOutDeviceNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//领用机台数
            }else if (type.equals("1")){
                map.putAll(cabinetFormDao.outTopQueryStagingNum(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//取出暂存状态刀具的数量
                map1.putAll(cabinetFormDao.outTopQueryOutOrderNum(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//领用订单数
                map2.putAll(cabinetFormDao.outTopQueryOutNameNum(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//领用人数
                map3.putAll(cabinetFormDao.outTopQueryOutSkuNum(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//领用sku数
                map4.putAll(cabinetFormDao.outTopQueryOutDeviceNum(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//领用机台数
            }else{
                map.putAll(cabinetFormDao.outTopQueryStagingNum(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//取出暂存状态刀具的数量
                map1.putAll(cabinetFormDao.outTopQueryOutOrderNum(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//领用订单数
                map2.putAll(cabinetFormDao.outTopQueryOutNameNum(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//领用人数
                map3.putAll(cabinetFormDao.outTopQueryOutSkuNum(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//领用sku数
                map4.putAll(cabinetFormDao.outTopQueryOutDeviceNum(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//领用机台数
            }
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            list.add(map4);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==0){//顶部数据  指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            HashMap map = cabinetFormDao.outTopQueryStagingNum(start,end,code, mainCabCode);//取出暂存状态刀具的数量
            map.put("title","取出数量(支)");
            map.put("sign","16");
            HashMap map1 = cabinetFormDao.outTopQueryOutOrderNum(start,end,code, mainCabCode);//领用订单数
            map1.put("title","领用订单数(个)");
            map1.put("sign","11");
            HashMap map2 = cabinetFormDao.outTopQueryOutNameNum(start,end,code, mainCabCode);//领用人数
            map2.put("title","领用人数(人)");
            map2.put("sign","4");
            HashMap map3 = cabinetFormDao.outTopQueryOutSkuNum(start,end,code, mainCabCode);//领用sku数
            map3.put("title","领用sku数(支)");
            map3.put("sign","16");
            HashMap map4 = cabinetFormDao.outTopQueryOutDeviceNum(start,end,code, mainCabCode);//领用机台数
            map4.put("title","领用机台数(台)");
            map4.put("sign","3");
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            list.add(map4);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(type)&&click==1){//暂存数量点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryStagingNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryStagingNumClick(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryStagingNumClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==2){//领用订单数点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutOrderNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutOrderNumClick(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutOrderNumClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==3){//领用人数点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutNameNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutNameNumClick(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutNameNumClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==4){//领用sku数点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutSkuNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutSkuNumClick(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutSkuNumClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==5){//领用机台数点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutDeviceNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutDeviceNumClick(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutDeviceNumClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==1){//暂存数量点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.outTopQueryStagingNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==2){//领用订单数点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutOrderNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==3){//领用人数点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutNameNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==4){//领用sku数点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutSkuNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==5){//领用机台数点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.outTopQueryOutDeviceNumClick(start,end,code, mainCabCode));
        }
        return JsonResult.fail("查询失败");
    }

    @Override
    public JsonResult outFirstChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm1 = new HashMap();
        hm1.put("title","暂存取出记录排名(按产品)");
        List list1 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list1.addAll(cabinetFormDao.outProductByProduct(start,end,code, mainCabCode));//取出产品排名按产品
        }
        if (type.equals("0")){
            list1.addAll(cabinetFormDao.outProductByProduct(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//取出产品排名按产品
        }else if(type.equals("1")){
            list1.addAll(cabinetFormDao.outProductByProduct(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//取出产品排名按产品
        }else if (type.equals("2")){
            list1.addAll(cabinetFormDao.outProductByProduct(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//取出产品排名按产品
        }
        hm1.put("data",list1);
        return JsonResult.success("查询成功",hm1);
    }

    @Override
    public JsonResult outSecondChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm2 = new HashMap();
        hm2.put("title","暂存取出记录排名(按产品类型)");
        List list2 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list2.addAll(cabinetFormDao.outProductByType(start,end,code,mainCabCode));//取出产品排名按产品按产品类型
        }
        if (type.equals("0")){
            list2.addAll(cabinetFormDao.outProductByType(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//取出产品排名按产品按产品类型
        }else if(type.equals("1")){
            list2.addAll(cabinetFormDao.outProductByType(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//取出产品排名按产品按产品类型
        }else if (type.equals("2")){
            list2.addAll(cabinetFormDao.outProductByType(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//取出产品排名按产品按产品类型
        }
        hm2.put("data",list2);
        return JsonResult.success("查询成功",hm2);
    }

    @Override
    public JsonResult outThirdChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm3 = new HashMap();
        hm3.put("title","暂存取出记录排名(按人员)");
        List list3 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list3.addAll(cabinetFormDao.outRankByCreatorName(start,end,code,mainCabCode));//人员取出记录排名按人员
        }
        if (type.equals("0")){
            list3.addAll(cabinetFormDao.outRankByCreatorName(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//人员取出记录排名按人员
        }else if(type.equals("1")){
            list3.addAll(cabinetFormDao.outRankByCreatorName(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//人员取出记录排名按人员
        }else if (type.equals("2")){
            list3.addAll(cabinetFormDao.outRankByCreatorName(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//人员取出记录排名按人员
        }
        hm3.put("data",list3);
        return JsonResult.success("查询成功",hm3);
    }

    @Override
    public JsonResult list4(String type, String startTime, String endTime, int click, String code, String mainCabCode) {//盘验选项卡
        if (StringUtils.isNotBlank(type)&&click==0){//顶部数据  固定时间
            HashMap map = new HashMap(){{put("title","待盘验刀具数量(支)");put("sign","0");}};
            HashMap map1 = new HashMap(){{put("title","已盘验报修刀具数量(支)");put("sign","16");}};
            HashMap map2 = new HashMap(){{put("title","已盘验报废刀具数量(支)");put("sign","16");}};
            HashMap map3 = new HashMap(){{put("title","已盘验暂存刀具数量(支)");put("sign","16");}};
            HashMap map4 = new HashMap(){{put("title","异常刀具数量(支)");put("sign","8");}};
            HashMap map5 = new HashMap(){{put("title","盘验缺失刀具数量(支)");put("sign","16");}};
            map.putAll(cabinetFormDao.checkTopQueryNotCheckNum(code,mainCabCode));//待盘验产品数
            if (type.equals("0")){
                map1.putAll(cabinetFormDao.checkTopQueryRepairOrderNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//已盘验修磨产品数
                map2.putAll(cabinetFormDao.checkTopQueryRecycleOrderNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//已盘验报废产品数
                map3.putAll(cabinetFormDao.checkTopQueryStagingOrderNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//已盘验暂存产品数
                map4.putAll(cabinetFormDao.checkTopQueryUnusualNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//盘验异常产品数
                map5.putAll(cabinetFormDao.checkTopQueryDefectNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//盘验缺失数
            }else if (type.equals("1")){
                map1.putAll(cabinetFormDao.checkTopQueryRepairOrderNum(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//已盘验修磨产品数
                map2.putAll(cabinetFormDao.checkTopQueryRecycleOrderNum(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//已盘验报废产品数
                map3.putAll(cabinetFormDao.checkTopQueryStagingOrderNum(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//已盘验暂存产品数
                map4.putAll(cabinetFormDao.checkTopQueryUnusualNum(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//盘验异常产品数
                map5.putAll(cabinetFormDao.checkTopQueryDefectNum(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//盘验缺失数
            }else{
                map1.putAll(cabinetFormDao.checkTopQueryRepairOrderNum(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//已盘验修磨产品数
                map2.putAll(cabinetFormDao.checkTopQueryRecycleOrderNum(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//已盘验报废产品数
                map3.putAll(cabinetFormDao.checkTopQueryStagingOrderNum(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//已盘验暂存产品数
                map4.putAll(cabinetFormDao.checkTopQueryUnusualNum(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//盘验异常产品数
                map5.putAll(cabinetFormDao.checkTopQueryDefectNum(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//盘验缺失数
            }
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            list.add(map4);
            list.add(map5);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==0){//顶部数据  指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            HashMap map = cabinetFormDao.checkTopQueryNotCheckNum(code, mainCabCode);//待盘验产品数
            map.put("title","待盘验刀具数量(支)");
            map.put("sign","0");
            HashMap map1 = cabinetFormDao.checkTopQueryRepairOrderNum(start,end,code, mainCabCode);//盘验修磨产品数
            map1.put("title","已盘验报修刀具数量(支)");
            map1.put("sign","16");
            HashMap map2 = cabinetFormDao.checkTopQueryRecycleOrderNum(start,end,code, mainCabCode);//盘验报废产品数
            map2.put("title","已盘验报废刀具数量(支)");
            map2.put("sign","16");
            HashMap map3 = cabinetFormDao.checkTopQueryStagingOrderNum(start,end,code, mainCabCode);//盘验暂存产品数
            map3.put("title","已盘验暂存刀具数量(支)");
            map3.put("sign","16");
            HashMap map4 = cabinetFormDao.checkTopQueryUnusualNum(start,end,code, mainCabCode);//盘验异常数
            map4.put("title","异常刀具数量(支)");
            map4.put("sign","8");
            HashMap map5 = cabinetFormDao.checkTopQueryDefectNum(start,end,code, mainCabCode);//盘验缺失数
            map5.put("title","盘验缺失刀具数量(支)");
            map5.put("sign","16");
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            list.add(map4);
            list.add(map5);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(type)&&click==1){//待盘验产品数 固定时间
            return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryNotCheckNumClick(code,mainCabCode));
        }
        if (StringUtils.isNotBlank(type)&&click==2){//盘验修磨产品数 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRepairOrderNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRepairOrderNumClick(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRepairOrderNumClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==3){//盘验报废产品数 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRecycleOrderNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRecycleOrderNumClick(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRecycleOrderNumClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==4){//盘验暂存产品数 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryStagingOrderNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryStagingOrderNumClick(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryStagingOrderNumClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==5){//盘验异常数 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryUnusualNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryUnusualNumClick(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryUnusualNumClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==6){//盘验缺失数
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryDefectNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryDefectNumClick(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryDefectNumClick(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==1){//待盘验任务数 指定时间
            return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryNotCheckNumClick(code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==2){//盘验修磨产品数 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRepairOrderNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==3){//盘验报废产品数 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRecycleOrderNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==4){//盘验暂存产品数 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryStagingOrderNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==5){//盘验异常数 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryUnusualNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==6){//盘验缺失数
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryDefectNumClick(start,end,code, mainCabCode));
        }
        return JsonResult.fail("查询失败");
    }

    @Override
    public JsonResult checkFirstChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm1 = new HashMap();
        hm1.put("title","刀具消耗排名(按人员)");
        List list1 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list1.addAll(cabinetFormDao.checkRankByCreatorName(start,end,code,mainCabCode));//盘验刀具消耗按人员
        }
        if (type.equals("0")){
            list1.addAll(cabinetFormDao.checkRankByCreatorName(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验刀具消耗按人员
        }else if(type.equals("1")){
            list1.addAll(cabinetFormDao.checkRankByCreatorName(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//盘验刀具消耗按人员
        }else if (type.equals("2")){
            list1.addAll(cabinetFormDao.checkRankByCreatorName(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//盘验刀具消耗按人员
        }
        hm1.put("data",list1);
        return JsonResult.success("查询成功",hm1);
    }

    @Override
    public JsonResult checkSecondChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm2 = new HashMap();
        hm2.put("title","刀具消耗排名(按车间)");
        List list2 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list2.addAll(cabinetFormDao.checkRankByWorkshop(start,end,code,mainCabCode));//盘验刀具消耗按车间
        }
        if (type.equals("0")){
            list2.addAll(cabinetFormDao.checkRankByWorkshop(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验刀具消耗按车间
        }else if(type.equals("1")){
            list2.addAll(cabinetFormDao.checkRankByWorkshop(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//盘验刀具消耗按车间
        }else if (type.equals("2")){
            list2.addAll(cabinetFormDao.checkRankByWorkshop(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//盘验刀具消耗按车间
        }
        hm2.put("data",list2);
        return JsonResult.success("查询成功",hm2);
    }

    @Override
    public JsonResult checkThirdChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm3 = new HashMap();
        hm3.put("title","刀具消耗排名(按产品)");
        List list3 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list3.addAll(cabinetFormDao.checkRankBySkuName(start,end,code,mainCabCode));//盘验刀具消耗按产品
        }
        if (type.equals("0")){
            list3.addAll(cabinetFormDao.checkRankBySkuName(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验刀具消耗按产品
        }else if(type.equals("1")){
            list3.addAll(cabinetFormDao.checkRankBySkuName(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//盘验刀具消耗按产品
        }else if (type.equals("2")){
            list3.addAll(cabinetFormDao.checkRankBySkuName(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//盘验刀具消耗按产品
        }
        hm3.put("data",list3);
        return JsonResult.success("查询成功",hm3);
    }

    @Override
    public JsonResult checkFourthChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm4 = new HashMap();
        hm4.put("title","刀具消耗排名(按日期)");
        hm4.put("date","yes");
        List list4 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list4.addAll(cabinetFormDao.checkRankByDate(start,end,code,mainCabCode));//盘验刀具消耗按日期
        }
        if (type.equals("0")){
            list4.addAll(cabinetFormDao.checkRankByDay(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//盘验刀具消耗按日期
        }else if(type.equals("1")){
            list4.addAll(cabinetFormDao.checkRankByDate(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//盘验刀具消耗按日期
        }else if (type.equals("2")){
            list4.addAll(cabinetFormDao.checkRankByDate(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//盘验刀具消耗按日期
        }
        hm4.put("data",list4);
        return JsonResult.success("查询成功",hm4);
    }

    @Override
    public JsonResult checkFifthChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm5 = new HashMap();
        hm5.put("title","盘验缺失排名(按产品)");
        List list5 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list5.addAll(cabinetFormDao.checkLoseBySkuName(start,end,code,mainCabCode));//盘验缺失排名按产品
        }
        if (type.equals("0")){
            list5.addAll(cabinetFormDao.checkLoseBySkuName(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验缺失排名按产品
        }else if(type.equals("1")){
            list5.addAll(cabinetFormDao.checkLoseBySkuName(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//盘验缺失排名按产品
        }else if (type.equals("2")){
            list5.addAll(cabinetFormDao.checkLoseBySkuName(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//盘验缺失排名按产品
        }
        hm5.put("data",list5);
        return JsonResult.success("查询成功",hm5);
    }

    @Override
    public JsonResult list5(String type, String dateType, String startTime, String endTime, int click, String code, String mainCabCode) {//修磨选项卡
        //获取时间
        dateTimeByDateType(dateType);

        if (StringUtils.isNotBlank(type)&&click==0){//顶部数据  固定时间
            HashMap map = new HashMap(){{put("title","待盘验报修刀具数量(支)");put("sign","7");}};
            HashMap map1 = new HashMap(){{put("title","已盘验报修刀具数量(支)");put("sign","18");}};
            HashMap map2 = new HashMap(){{put("title","盘验报修异常刀具数量(支)");put("sign","8");}};
            HashMap map3 = new HashMap(){{put("title","报修订单刀具数量(支)");put("sign","23");}};
            HashMap map4 = new HashMap(){{put("title","报修订单完成率");put("sign","2");}};
            HashMap map5 = new HashMap(){{put("title","报修刀具完结率");put("sign","0");}};
            if (type.equals("0")){
                map.putAll(cabinetFormDao.repairTopQueryRepairNum2(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//修磨待盘验产品数
                map1.putAll(cabinetFormDao.repairTopQueryRepairKnifeNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//修磨刀具数量
                map2.putAll(cabinetFormDao.repairTopQueryUnusualNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//盘验修磨异常产品数
                map3.putAll(cabinetFormDao.checkTopQueryRepairOrderNum(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//维修订单数
                map4.putAll(cabinetFormDao.repairTopQueryRepairOrderRank(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//维修订单完成率
                map5.putAll(cabinetFormDao.repairTopQueryRepairEndRank(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//修磨刀具完结率
            }else if (type.equals("1")){
                map.putAll(cabinetFormDao.repairTopQueryRepairNum2(startWeekDateTime,endWeekDateTime,code, mainCabCode));//修磨待盘验产品数
                map1.putAll(cabinetFormDao.repairTopQueryRepairKnifeNum(startWeekDateTime,endWeekDateTime,code, mainCabCode));//修磨刀具数量
                map2.putAll(cabinetFormDao.repairTopQueryUnusualNum(startWeekDateTime,endWeekDateTime,code, mainCabCode));//盘验修磨异常产品数
                map3.putAll(cabinetFormDao.checkTopQueryRepairOrderNum(startWeekDateTime,endWeekDateTime,code, mainCabCode));//维修订单数
                map4.putAll(cabinetFormDao.repairTopQueryRepairOrderRank(startWeekDateTime,endWeekDateTime,code, mainCabCode));//维修订单完成率
                map5.putAll(cabinetFormDao.repairTopQueryRepairEndRank(startWeekDateTime,endWeekDateTime,code, mainCabCode));//修磨刀具完结率
            }else{
                map.putAll(cabinetFormDao.repairTopQueryRepairNum2(startMonthDateTime,endMonthDateTime,code, mainCabCode));//修磨待盘验产品数
                map1.putAll(cabinetFormDao.repairTopQueryRepairKnifeNum(startMonthDateTime,endMonthDateTime,code, mainCabCode));//修磨刀具数量
                map2.putAll(cabinetFormDao.repairTopQueryUnusualNum(startMonthDateTime,endMonthDateTime,code, mainCabCode));//盘验修磨异常产品数
                map3.putAll(cabinetFormDao.checkTopQueryRepairOrderNum(startMonthDateTime,endMonthDateTime,code, mainCabCode));//维修订单数
                map4.putAll(cabinetFormDao.repairTopQueryRepairOrderRank(startMonthDateTime,endMonthDateTime,code, mainCabCode));//维修订单完成率
                map5.putAll(cabinetFormDao.repairTopQueryRepairEndRank(startMonthDateTime,endMonthDateTime,code, mainCabCode));//修磨刀具完结率
            }
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            list.add(map4);
            list.add(map5);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==0){//顶部数据  指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            HashMap map = cabinetFormDao.repairTopQueryRepairNum2(start,end,code, mainCabCode);//修磨待盘验产品数
            map.put("title","待盘验报修刀具数量(支)");
            map.put("sign","7");
            HashMap map1 = cabinetFormDao.repairTopQueryRepairKnifeNum(start,end,code, mainCabCode);//修磨刀具数量
            map1.put("title","已盘验报修刀具数量(支)");
            map1.put("sign","18");
            HashMap map2 = cabinetFormDao.repairTopQueryUnusualNum(start,end,code, mainCabCode);//盘验修磨异常产品数 盘验前是修磨 盘验后异常
            map2.put("title","盘验报修异常刀具数量(支)");
            map2.put("sign","8");
            HashMap map3 = cabinetFormDao.checkTopQueryRepairOrderNum(start,end,code, mainCabCode);//维修订单数
            map3.put("title","报修订单刀具数量(支)");
            map3.put("sign","23");
            HashMap map4 = cabinetFormDao.repairTopQueryRepairOrderRank(start,end,code, mainCabCode);//维修订单完成率
            map4.put("title","报修订单完成率");
            map4.put("sign","2");
            HashMap map5 = cabinetFormDao.repairTopQueryRepairEndRank(start,end,code, mainCabCode);//修磨刀具完结率
            map5.put("title","报修刀具完结率");
            map5.put("sign","0");
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            list.add(map4);
            list.add(map5);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(type)&&click==1){//修磨盘验产品数 点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairNumClick2(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairNumClick2(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairNumClick2(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==2){//修磨刀具数量 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairKnifeNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairKnifeNumClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairKnifeNumClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==3){//盘验修磨异常数 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryUnusualNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryUnusualNumClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryUnusualNumClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==4){//维修订单数 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRepairOrderNumClick(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRepairOrderNumClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRepairOrderNumClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==5){//维修订单完成率 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairOrderRankClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairOrderRankClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairOrderRankClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }

        if (StringUtils.isNotBlank(type)&&click==6){//修磨刀具完结率 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairEndRankClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairEndRankClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairEndRankClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==1){//修磨刀具数量 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairKnifeNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==2){//修磨盘验产品数 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairNumClick2(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==3){//盘验修磨异常数 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryUnusualNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==4){//维修订单数 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRepairOrderNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==5){//维修订单完成率 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairOrderRankClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==6){//修磨刀具完结率 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryRepairEndRankClick(start,end,code, mainCabCode));
        }
        return JsonResult.fail("查询失败");
    }

    @Override
    public JsonResult repairFirstChart(String type, String dateType, String startTime, String endTime, String code, String mainCabCode) {
        //获取时间
        dateTimeByDateType(dateType);

        HashMap hm1 = new HashMap();
        hm1.put("title","刀具消耗排名(按人员)");
        List list1 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list1.addAll(cabinetFormDao.repairRankByCreatorName(start,end,code,mainCabCode));//盘验修磨刀具消耗按人员
            hm1.put("totalSumOne",cabinetFormDao.recycleRankByCreatorNameTotal(start,end,code,mainCabCode,StorageInventoryInout.BusinessType.repair.getValue()));
        }
        if (type.equals("0")){
            list1.addAll(cabinetFormDao.repairRankByCreatorName(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验修磨刀具消耗按人员
            hm1.put("totalSumOne",cabinetFormDao.recycleRankByCreatorNameTotal(dayUtil().get(0),dayUtil().get(1),code,mainCabCode,StorageInventoryInout.BusinessType.repair.getValue()));
        }else if(type.equals("1")){
            list1.addAll(cabinetFormDao.repairRankByCreatorName(startWeekDateTime,endWeekDateTime,code, mainCabCode));//盘验修磨刀具消耗按人员
            hm1.put("totalSumOne",cabinetFormDao.recycleRankByCreatorNameTotal(startWeekDateTime,endWeekDateTime,code,mainCabCode,StorageInventoryInout.BusinessType.repair.getValue()));
        }else if (type.equals("2")){
            list1.addAll(cabinetFormDao.repairRankByCreatorName(startMonthDateTime,endMonthDateTime,code, mainCabCode));//盘验修磨刀具消耗按人员
            hm1.put("totalSumOne",cabinetFormDao.recycleRankByCreatorNameTotal(startMonthDateTime,endMonthDateTime,code,mainCabCode,StorageInventoryInout.BusinessType.repair.getValue()));
        }
        hm1.put("data",list1);
        return JsonResult.success("查询成功",hm1);
    }

    @Override
    public JsonResult repairSecondChart(String type, String dateType, String startTime, String endTime, String code, String mainCabCode) {
        //获取时间
        dateTimeByDateType(dateType);

        HashMap hm2 = new HashMap();
        hm2.put("title","刀具消耗排名(按车间)");
        List list2 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list2.addAll(cabinetFormDao.repairRankByWorkshop(start,end,code,mainCabCode));//盘验修磨刀具消耗按车间
        }
        if (type.equals("0")){
            list2.addAll(cabinetFormDao.repairRankByWorkshop(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验修磨刀具消耗按车间
        }else if(type.equals("1")){
            list2.addAll(cabinetFormDao.repairRankByWorkshop(startWeekDateTime,endWeekDateTime,code, mainCabCode));//盘验修磨刀具消耗按车间
        }else if (type.equals("2")){
            list2.addAll(cabinetFormDao.repairRankByWorkshop(startMonthDateTime,endMonthDateTime,code, mainCabCode));//盘验修磨刀具消耗按车间
        }
        hm2.put("data",list2);
        return JsonResult.success("查询成功",hm2);
    }

    @Override
    public JsonResult repairThirdChart(String type, String dateType, String startTime, String endTime, String code, String mainCabCode) {
        //获取时间
        dateTimeByDateType(dateType);

        HashMap hm3 = new HashMap();
        hm3.put("title","刀具消耗排名(按产品)");
        List list3 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list3.addAll(cabinetFormDao.repairRankBySkuName(start,end,code,mainCabCode));//盘验修磨刀具消耗按产品
        }
        if (type.equals("0")){
            list3.addAll(cabinetFormDao.repairRankBySkuName(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验修磨刀具消耗按产品
        }else if(type.equals("1")){
            list3.addAll(cabinetFormDao.repairRankBySkuName(startWeekDateTime,endWeekDateTime,code, mainCabCode));//盘验修磨刀具消耗按产品
        }else if (type.equals("2")){
            list3.addAll(cabinetFormDao.repairRankBySkuName(startMonthDateTime,endMonthDateTime,code, mainCabCode));//盘验修磨刀具消耗按产品
        }
        hm3.put("data",list3);
        return JsonResult.success("查询成功",hm3);
    }

    @Override
    public JsonResult repairFourthChart(String type, String dateType, String startTime, String endTime, String code, String mainCabCode) {

        //获取时间
        dateTimeByDateType(dateType);

        HashMap hm4 = new HashMap();
        hm4.put("title","刀具消耗排名(按机床)");
        List list4 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list4.addAll(cabinetFormDao.repairRankByDevice(start,end,code,mainCabCode));//盘验修磨刀具消耗按机床
        }
        if (type.equals("0")){
            list4.addAll(cabinetFormDao.repairRankByDevice(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验修磨刀具消耗按机床
        }else if(type.equals("1")){
            list4.addAll(cabinetFormDao.repairRankByDevice(startWeekDateTime,endWeekDateTime,code, mainCabCode));//盘验修磨刀具消耗按机床
        }else if (type.equals("2")){
            list4.addAll(cabinetFormDao.repairRankByDevice(startMonthDateTime,endMonthDateTime,code, mainCabCode));//盘验修磨刀具消耗按机床
        }
        hm4.put("data",list4);
        return JsonResult.success("查询成功",hm4);
    }

    @Override
    public JsonResult repairFifthChart(String type, String dateType, String startTime, String endTime, String code, String mainCabCode) {
        //获取时间
        dateTimeByDateType(dateType);

        HashMap hm5 = new HashMap();
        hm5.put("title","刀具消耗排名(按日期)");
        hm5.put("date","yes");
        List list5 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list5.addAll(cabinetFormDao.repairRankByDate(start,end,code,mainCabCode));//盘验修磨刀具消耗按日期
        }
        if (type.equals("0")){
            list5.addAll(cabinetFormDao.repairRankByDay(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//盘验修磨刀具消耗按日期
        }else if(type.equals("1")){
            list5.addAll(cabinetFormDao.repairRankByDate(startWeekDateTime,endWeekDateTime,code, mainCabCode));//盘验修磨刀具消耗按日期
        }else if (type.equals("2")){
            list5.addAll(cabinetFormDao.repairRankByDate(startMonthDateTime,endMonthDateTime,code, mainCabCode));//盘验修磨刀具消耗按日期
        }
        hm5.put("data",list5);
        return JsonResult.success("查询成功",hm5);
    }

    @Override
    public JsonResult list6(String type, String dateType, String startTime, String endTime, int click, String code, String mainCabCode) {//报废选项卡
        //获取时间
        dateTimeByDateType(dateType);

        if (StringUtils.isNotBlank(type)&&click==0){//顶部数据  固定时间
            HashMap map = new HashMap(){{put("title","待盘验报废刀具数量(支)");put("sign","7");}};
            HashMap map1 = new HashMap(){{put("title","已盘验报废刀具数量(支)");put("sign","18");}};
            HashMap map2 = new HashMap(){{put("title","盘验报废异常刀具数量(支)");put("sign","8");}};
            HashMap map3 = new HashMap(){{put("title","报废订单刀具数量(支)");put("sign","16");}};
            HashMap map4 = new HashMap(){{put("title","报废订单完成率");put("sign","2");}};
            HashMap map5 = new HashMap(){{put("title","报废刀具完结率");put("sign","0");}};
            if (type.equals("0")){
                map.putAll(cabinetFormDao.recycleTopQueryRecycleNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//报废待盘验产品数
                map1.putAll(cabinetFormDao.recycleTopQueryRecycleKnifeNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//报废刀具数量
                map2.putAll(cabinetFormDao.recycleTopQueryUnusualNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//盘验报废异常产品数
                map3.putAll(cabinetFormDao.checkTopQueryRecycleOrderNum(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//报废订单数
                map4.putAll(cabinetFormDao.recycleTopQueryRecycleOrderRank(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//报废订单完成率
                map5.putAll(cabinetFormDao.recycleTopQueryRecycleEndRank(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//报废刀具完结率
            }else if (type.equals("1")){
                map.putAll(cabinetFormDao.recycleTopQueryRecycleNum(startWeekDateTime,endWeekDateTime,code, mainCabCode));//报废待盘验产品数
                map1.putAll(cabinetFormDao.recycleTopQueryRecycleKnifeNum(startWeekDateTime,endWeekDateTime,code, mainCabCode));//报废刀具数量
                map2.putAll(cabinetFormDao.recycleTopQueryUnusualNum(startWeekDateTime,endWeekDateTime,code, mainCabCode));//盘验报废异常产品数
                map3.putAll(cabinetFormDao.checkTopQueryRecycleOrderNum(startWeekDateTime,endWeekDateTime,code, mainCabCode));//报废订单数
                map4.putAll(cabinetFormDao.recycleTopQueryRecycleOrderRank(startWeekDateTime,endWeekDateTime,code, mainCabCode));//报废订单完成率
                map5.putAll(cabinetFormDao.recycleTopQueryRecycleEndRank(startWeekDateTime,endWeekDateTime,code, mainCabCode));//报废刀具完结率
            }else{
                map.putAll(cabinetFormDao.recycleTopQueryRecycleNum(startMonthDateTime,endMonthDateTime,code, mainCabCode));//报废待盘验产品数
                map1.putAll(cabinetFormDao.recycleTopQueryRecycleKnifeNum(startMonthDateTime,endMonthDateTime,code, mainCabCode));//报废刀具数量
                map2.putAll(cabinetFormDao.recycleTopQueryUnusualNum(startMonthDateTime,endMonthDateTime,code, mainCabCode));//盘验报废异常产品数
                map3.putAll(cabinetFormDao.checkTopQueryRecycleOrderNum(startMonthDateTime,endMonthDateTime,code, mainCabCode));//报废订单数
                map4.putAll(cabinetFormDao.recycleTopQueryRecycleOrderRank(startMonthDateTime,endMonthDateTime,code, mainCabCode));//报废订单完成率
                map5.putAll(cabinetFormDao.recycleTopQueryRecycleEndRank(startMonthDateTime,endMonthDateTime,code, mainCabCode));//报废刀具完结率
            }
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            list.add(map4);
            list.add(map5);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==0){//顶部数据  指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            HashMap map = cabinetFormDao.recycleTopQueryRecycleNum(start,end,code, mainCabCode);//报废待盘验产品数
            map.put("title","待盘验报废刀具数量(支)");
            map.put("sign","7");
            HashMap map1 = cabinetFormDao.recycleTopQueryRecycleKnifeNum(start,end,code, mainCabCode);//报废刀具数量
            map1.put("title","已盘验报废刀具数量(支)");
            map1.put("sign","18");
            HashMap map2 = cabinetFormDao.recycleTopQueryUnusualNum(start,end,code, mainCabCode);//盘验报废异常产品数
            map2.put("title","盘验报废异常刀具数量(支)");
            map2.put("sign","8");
            HashMap map3 = cabinetFormDao.checkTopQueryRecycleOrderNum(start,end,code, mainCabCode);//报废订单数
            map3.put("title","报废订单刀具数量(支)");
            map3.put("sign","16");
            HashMap map4 = cabinetFormDao.recycleTopQueryRecycleOrderRank(start,end,code, mainCabCode);//报废订单完成率
            map4.put("title","报废订单完成率");
            map4.put("sign","2");
            HashMap map5 = cabinetFormDao.recycleTopQueryRecycleEndRank(start,end,code, mainCabCode);//报废刀具完结率
            map5.put("title","报废刀具完结率");
            map5.put("sign","0");
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            list.add(map4);
            list.add(map5);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(type)&&click==1){//报废待盘验任务数点击  固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleNumClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleNumClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==2){//报废刀具数量点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleKnifeNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleKnifeNumClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleKnifeNumClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==3){//报废盘验异常数点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryUnusualNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryUnusualNumClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryUnusualNumClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==4){//报废订单数点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRecycleOrderNumClick(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRecycleOrderNumClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRecycleOrderNumClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==5){//报废订单完成率点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleOrderRankClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleOrderRankClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleOrderRankClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==6){//报废刀具完结率点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleEndRankClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleEndRankClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleEndRankClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==1){//报废刀具数量点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleKnifeNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==2){//报废待盘验任务数点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==3){//报废盘验异常数点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryUnusualNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==4){//报废盘验修磨产品数点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryRecycleOrderNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==5){//报废订单完成率点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleOrderRankClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==6){//报废刀具完结率点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryRecycleEndRankClick(start,end,code, mainCabCode));
        }
        return JsonResult.fail("查询失败");
    }

    @Override
    public JsonResult recycleFirstChart(String type, String dateType, String startTime, String endTime, String code, String mainCabCode) {
        //获取时间
        dateTimeByDateType(dateType);

        HashMap hm1 = new HashMap();
        hm1.put("title","刀具消耗排名(按人员)");
        List list1 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list1.addAll(cabinetFormDao.recycleRankByCreatorName(start,end,code,mainCabCode));//盘验报废刀具消耗按人员
            hm1.put("totalSumOne",cabinetFormDao.recycleRankByCreatorNameTotal(start,end,code,mainCabCode,StorageInventoryInout.BusinessType.recycle.getValue()));
        }
        if (type.equals("0")){
            list1.addAll(cabinetFormDao.recycleRankByCreatorName(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验报废刀具消耗按人员
            hm1.put("totalSumOne",cabinetFormDao.recycleRankByCreatorNameTotal(dayUtil().get(0),dayUtil().get(1),code, mainCabCode,StorageInventoryInout.BusinessType.recycle.getValue()));
        }else if(type.equals("1")){
            list1.addAll(cabinetFormDao.recycleRankByCreatorName(startWeekDateTime,endWeekDateTime,code, mainCabCode));//盘验报废刀具消耗按人员
            hm1.put("totalSumOne",cabinetFormDao.recycleRankByCreatorNameTotal(startWeekDateTime,endWeekDateTime,code, mainCabCode,StorageInventoryInout.BusinessType.recycle.getValue()));
        }else if (type.equals("2")){
            list1.addAll(cabinetFormDao.recycleRankByCreatorName(startMonthDateTime, endMonthDateTime,code, mainCabCode));//盘验报废刀具消耗按人员
            hm1.put("totalSumOne",cabinetFormDao.recycleRankByCreatorNameTotal(startMonthDateTime, endMonthDateTime,code, mainCabCode,StorageInventoryInout.BusinessType.recycle.getValue()));
        }
        hm1.put("data", list1);
        return JsonResult.success("查询成功",hm1);
    }

    @Override
    public JsonResult recycleSecondChart(String type, String dateType, String startTime, String endTime, String code, String mainCabCode) {
        //获取时间
        dateTimeByDateType(dateType);

        HashMap hm2 = new HashMap();
        hm2.put("title","刀具消耗排名(按车间)");
        List list2 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list2.addAll(cabinetFormDao.recycleRankByWorkshop(start,end,code,mainCabCode));//盘验报废刀具消耗按车间
        }
        if (type.equals("0")){
            list2.addAll(cabinetFormDao.recycleRankByWorkshop(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验报废刀具消耗按车间
        }else if(type.equals("1")){
            list2.addAll(cabinetFormDao.recycleRankByWorkshop(startWeekDateTime,endWeekDateTime,code, mainCabCode));//盘验报废刀具消耗按车间
        }else if (type.equals("2")){
            list2.addAll(cabinetFormDao.recycleRankByWorkshop(startMonthDateTime, endMonthDateTime,code, mainCabCode));//盘验报废刀具消耗按车间
        }
        hm2.put("data",list2);
        return JsonResult.success("查询成功",hm2);
    }

    @Override
    public JsonResult recycleThirdChart(String type, String dateType, String startTime, String endTime, String code, String mainCabCode) {
        //获取时间
        dateTimeByDateType(dateType);

        HashMap hm3 = new HashMap();
        hm3.put("title","刀具消耗排名(按产品)");
        List list3 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list3.addAll(cabinetFormDao.recycleRankBySkuName(start,end,code,mainCabCode));//盘验报废刀具消耗按产品
        }
        if (type.equals("0")){
            list3.addAll(cabinetFormDao.recycleRankBySkuName(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验报废刀具消耗按产品
        }else if(type.equals("1")){
            list3.addAll(cabinetFormDao.recycleRankBySkuName(startWeekDateTime,endWeekDateTime,code, mainCabCode));//盘验报废刀具消耗按产品
        }else if (type.equals("2")){
            list3.addAll(cabinetFormDao.recycleRankBySkuName(startMonthDateTime, endMonthDateTime,code, mainCabCode));//盘验报废刀具消耗按产品
        }
        hm3.put("data",list3);
        return JsonResult.success("查询成功",hm3);
    }

    @Override
    public JsonResult recycleFourthChart(String type, String dateType, String startTime, String endTime, String code, String mainCabCode) {
        //获取时间
        dateTimeByDateType(dateType);

        HashMap hm4 = new HashMap();
        hm4.put("title","刀具消耗排名(按机床)");
        List list4 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list4.addAll(cabinetFormDao.recycleRankByDevice(start,end,code,mainCabCode));//盘验报废刀具消耗按机床
        }
        if (type.equals("0")){
            list4.addAll(cabinetFormDao.recycleRankByDevice(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验报废刀具消耗按机床
        }else if(type.equals("1")){
            list4.addAll(cabinetFormDao.recycleRankByDevice(startWeekDateTime,endWeekDateTime,code, mainCabCode));//盘验报废刀具消耗按机床
        }else if (type.equals("2")){
            list4.addAll(cabinetFormDao.recycleRankByDevice(startMonthDateTime, endMonthDateTime,code, mainCabCode));//盘验报废刀具消耗按机床
        }
        hm4.put("data",list4);
        return JsonResult.success("查询成功",hm4);
    }

    @Override
    public JsonResult recycleFifthChart(String type, String dateType, String startTime, String endTime, String code, String mainCabCode) {
        //获取时间
        dateTimeByDateType(dateType);

        HashMap hm5 = new HashMap();
        hm5.put("title","刀具消耗排名(按日期)");
        hm5.put("date","yes");
        List list5 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list5.addAll(cabinetFormDao.recycleRankByDate(start,end,code,mainCabCode));//盘验报废刀具消耗按日期
        }
        if (type.equals("0")){
            list5.addAll(cabinetFormDao.recycleRankByDay(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//盘验报废刀具消耗按日期
        }else if(type.equals("1")){
            list5.addAll(cabinetFormDao.recycleRankByDate(startWeekDateTime,endWeekDateTime,code, mainCabCode));//盘验报废刀具消耗按日期
        }else if (type.equals("2")){
            list5.addAll(cabinetFormDao.recycleRankByDate(startMonthDateTime, endMonthDateTime,code, mainCabCode));//盘验报废刀具消耗按日期
        }
        hm5.put("data",list5);
        return JsonResult.success("查询成功",hm5);
    }

    @Override
    public JsonResult getSpecStatisticsByDay(String code, String param, Integer businessType) {
        HashMap hm = new HashMap();
        switch (businessType){
            case 2:
                hm.put("title","报修统计(按天)");
                break;
            case 3:
                hm.put("title","报废统计(按天)");
                break;
            default:
                break;
        }

        List list = new ArrayList();
        list.addAll(cabinetFormDao.querySpecStatisticsByDay(code, param, businessType));
        hm.put("data",list);
        return JsonResult.success("查询成功",hm);
    }

    @Override
    public JsonResult getSpecMaterialModelComparison(String type, String dateType, String startTime, String endTime, String code, String mainCabCode, String param, Integer businessType) {
        HashMap hm = new HashMap();
        switch (businessType){
            case 2:
                hm.put("title","报修物料规格型号占比");
                break;
            case 3:
                hm.put("title","报废物料规格型号占比");
                break;
            default:
                break;
        }

        List list = new ArrayList();

        dateTimeByDateType(dateType);//获取时间

        if(StringUtils.isNotBlank(type)){

            if(type.equals("0")){ // 日
                list.addAll(cabinetFormDao.querySpecMC(FindDateStatusUtil.dayUtil().get(0),FindDateStatusUtil.dayUtil().get(1),code,param,mainCabCode,businessType));
                hm.put("totalSum",cabinetFormDao.querySpecMCTotal(FindDateStatusUtil.dayUtil().get(0),FindDateStatusUtil.dayUtil().get(1),code,param,mainCabCode,businessType));
                hm.put("totalSumOne",cabinetFormDao.querySpecMCTotalOne(FindDateStatusUtil.dayUtil().get(0),FindDateStatusUtil.dayUtil().get(1),code,param,mainCabCode,businessType));

            }else if(type.equals("1")){ // 周
                list.addAll(cabinetFormDao.querySpecMC(startWeekDateTime,endWeekDateTime,code,param,mainCabCode,businessType));
                hm.put("totalSum",cabinetFormDao.querySpecMCTotal(startWeekDateTime,endWeekDateTime,code,param,mainCabCode,businessType));
                hm.put("totalSumOne",cabinetFormDao.querySpecMCTotalOne(startWeekDateTime,endWeekDateTime,code,param,mainCabCode,businessType));

            }else if(type.equals("2")){ // 月
                list.addAll(cabinetFormDao.querySpecMC(startMonthDateTime,endMonthDateTime,code,param,mainCabCode,businessType));
                hm.put("totalSum",cabinetFormDao.querySpecMCTotal(startMonthDateTime,endMonthDateTime,code,param,mainCabCode,businessType));
                hm.put("totalSumOne",cabinetFormDao.querySpecMCTotalOne(startMonthDateTime,endMonthDateTime,code,param,mainCabCode,businessType));

            }

        }
        if(StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");

            list.addAll(cabinetFormDao.querySpecMC(start,end,code,param,mainCabCode,businessType));
            hm.put("totalSum",cabinetFormDao.querySpecMCTotal(start,end,code,param,mainCabCode,businessType));
            hm.put("totalSumOne",cabinetFormDao.querySpecMCTotalOne(start,end,code,param,mainCabCode,businessType));


        }
        hm.put("data",list);
        return JsonResult.success("查询成功",hm);
    }

    @Override
    public JsonResult list7(String type,String dateType, String startTime, String endTime, int click, String code, String mainCabCode) {//异常选项卡0

        //获取时间
        dateTimeByDateType(dateType);

        if (StringUtils.isNotBlank(type)&&click==0){//顶部数据  固定时间
            HashMap map = new HashMap(){{put("title","盘验异常刀具数量(支)");put("sign","8");}};
            HashMap map1 = new HashMap(){{put("title","暂存异常刀具数量(支)");put("sign","8");}};
            HashMap map2 = new HashMap(){{put("title","报修异常刀具数量(支)");put("sign","8");}};
            HashMap map3 = new HashMap(){{put("title","报废异常刀具数量(支)");put("sign","8");}};

            if (type.equals("0")){
                map.putAll(cabinetFormDao.checkTopQueryUnusualNum(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验异常产品数
                map1.putAll(cabinetFormDao.unusualTopQueryStagingUnusualNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//暂存异常产品数
                map2.putAll(cabinetFormDao.repairTopQueryUnusualNum(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//修磨异常产品数
                map3.putAll(cabinetFormDao.recycleTopQueryUnusualNum(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//报废异常产品数
            }else if (type.equals("1")){

                map.putAll(cabinetFormDao.checkTopQueryUnusualNum(startWeekDateTime, endWeekDateTime, code, mainCabCode));//盘验异常产品数
                map1.putAll(cabinetFormDao.unusualTopQueryStagingUnusualNum(startWeekDateTime, endWeekDateTime, code, mainCabCode));//暂存异常产品数
                map2.putAll(cabinetFormDao.repairTopQueryUnusualNum(startWeekDateTime, endWeekDateTime, code, mainCabCode));//修磨异常产品数
                map3.putAll(cabinetFormDao.recycleTopQueryUnusualNum(startWeekDateTime, endWeekDateTime, code, mainCabCode));//报废异常产品数

            }else{

                map.putAll(cabinetFormDao.checkTopQueryUnusualNum(startMonthDateTime, endMonthDateTime, code, mainCabCode));//盘验异常产品数
                map1.putAll(cabinetFormDao.unusualTopQueryStagingUnusualNum(startMonthDateTime, endMonthDateTime, code, mainCabCode));//暂存异常产品数
                map2.putAll(cabinetFormDao.repairTopQueryUnusualNum(startMonthDateTime, endMonthDateTime, code, mainCabCode));//修磨异常产品数
                map3.putAll(cabinetFormDao.recycleTopQueryUnusualNum(startMonthDateTime, endMonthDateTime, code, mainCabCode));//报废异常产品数

            }
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==0){//顶部数据  指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            HashMap map = cabinetFormDao.checkTopQueryUnusualNum(start,end,code, mainCabCode);//盘验异常数
            map.put("title","盘验异常刀具数量(支)");
            map.put("sign","8");
            HashMap map1 = cabinetFormDao.unusualTopQueryStagingUnusualNum(start,end,code, mainCabCode);//暂存异常数
            map1.put("title","暂存异常刀具数量(支)");
            map1.put("sign","8");
            HashMap map2 = cabinetFormDao.repairTopQueryUnusualNum(start,end,code, mainCabCode);//修磨异常数
            map2.put("title","报修异常刀具数量(支)");
            map2.put("sign","8");
            HashMap map3 = cabinetFormDao.recycleTopQueryUnusualNum(start,end,code, mainCabCode);//报废异常数
            map3.put("title","报废异常刀具数量(支)");
            map3.put("sign","8");
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(type)&&click==1){//盘验异常数点击  固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryUnusualNumClick(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryUnusualNumClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryUnusualNumClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==2){//暂存异常数点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.unusualTopQueryStagingNumClick(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.unusualTopQueryStagingNumClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.unusualTopQueryStagingNumClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==3){//修磨异常数点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryUnusualNumClick(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryUnusualNumClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryUnusualNumClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==4){//报废异常数点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryUnusualNumClick(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryUnusualNumClick(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryUnusualNumClick(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==1){//盘验异常数点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.checkTopQueryUnusualNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==2){//暂存异常数点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.unusualTopQueryStagingNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==3){//修磨异常数点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.repairTopQueryUnusualNumClick(start,end,code, mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==4){//报废异常数点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.recycleTopQueryUnusualNumClick(start,end,code, mainCabCode));
        }
        return JsonResult.fail("查询失败");
    }

    @Override
    public JsonResult unusualFirstChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm1 = new HashMap();
        hm1.put("title","刀具消耗排名(按人员)");
        List list1 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list1.addAll(cabinetFormDao.unusualRankByCreatorName(start,end,code,mainCabCode));//盘验异常刀具消耗按人员
        }
        if (type.equals("0")){
            list1.addAll(cabinetFormDao.unusualRankByCreatorName(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按人员
        }else if(type.equals("1")){
            list1.addAll(cabinetFormDao.unusualRankByCreatorName(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按人员
        }else if (type.equals("2")){
            list1.addAll(cabinetFormDao.unusualRankByCreatorName(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按人员
        }
        hm1.put("data",list1);
        return JsonResult.success("查询成功",hm1);
    }

    @Override
    public JsonResult unusualSecondChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm2 = new HashMap();
        hm2.put("title","刀具消耗排名(按车间)");
        List list2 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list2.addAll(cabinetFormDao.unusualRankByWorkshop(start,end,code,mainCabCode));//盘验异常刀具消耗按车间
        }
        if (type.equals("0")){
            list2.addAll(cabinetFormDao.unusualRankByWorkshop(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按车间
        }else if(type.equals("1")){
            list2.addAll(cabinetFormDao.unusualRankByWorkshop(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按车间
        }else if (type.equals("2")){
            list2.addAll(cabinetFormDao.unusualRankByWorkshop(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按车间
        }
        hm2.put("data",list2);
        return JsonResult.success("查询成功",hm2);
    }

    @Override
    public JsonResult unusualThirdChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm3 = new HashMap();
        hm3.put("title","刀具消耗排名(按产品)");
        List list3 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list3.addAll(cabinetFormDao.unusualRankBySkuName(start,end,code,mainCabCode));//盘验异常刀具消耗按产品
        }
        if (type.equals("0")){
            list3.addAll(cabinetFormDao.unusualRankBySkuName(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按产品
        }else if(type.equals("1")){
            list3.addAll(cabinetFormDao.unusualRankBySkuName(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按产品
        }else if (type.equals("2")){
            list3.addAll(cabinetFormDao.unusualRankBySkuName(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按产品
        }
        hm3.put("data",list3);
        return JsonResult.success("查询成功",hm3);
    }

    @Override
    public JsonResult unusualFourthChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm4 = new HashMap();
        hm4.put("title","刀具消耗排名(按机床)");
        List list4 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list4.addAll(cabinetFormDao.unusualRankByDevice(start,end,code,mainCabCode));//盘验异常刀具消耗按机床
        }
        if (type.equals("0")){
            list4.addAll(cabinetFormDao.unusualRankByDevice(dayUtil().get(0),dayUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按机床
        }else if(type.equals("1")){
            list4.addAll(cabinetFormDao.unusualRankByDevice(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按机床
        }else if (type.equals("2")){
            list4.addAll(cabinetFormDao.unusualRankByDevice(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按机床
        }
        hm4.put("data",list4);
        return JsonResult.success("查询成功",hm4);
    }

    @Override
    public JsonResult unusualFifthChart(String type, String startTime, String endTime, String code, String mainCabCode) {
        HashMap hm5 = new HashMap();
        hm5.put("title","刀具消耗排名(按日期)");
        hm5.put("date","yes");
        List list5 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            list5.addAll(cabinetFormDao.unusualRankByDate(start,end,code,mainCabCode));//盘验异常刀具消耗按日期
        }
        if (type.equals("0")){
            list5.addAll(cabinetFormDao.unusualRankByDay(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));//盘验异常刀具消耗按日期
        }else if(type.equals("1")){
            list5.addAll(cabinetFormDao.unusualRankByDate(weekUtil().get(0),weekUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按日期
        }else if (type.equals("2")){
            list5.addAll(cabinetFormDao.unusualRankByDate(dateUtil().get(0),dateUtil().get(1),code, mainCabCode));//盘验异常刀具消耗按日期
        }
        hm5.put("data",list5);
        return JsonResult.success("查询成功",hm5);
    }

    @Override
    public JsonResult list8(String type, String startTime, String endTime, int click, String code, String mainCabCode) {//售刀柜选项卡
        if (StringUtils.isNotBlank(type)&&click==0){//顶部数据  固定时间
            HashMap map = new HashMap(){{put("title","库存数量(支)");put("sign","30");}};
            HashMap map1 = new HashMap(){{put("title","库存告警数量(条)");put("sign","1");}};
            HashMap map2 = new HashMap(){{put("title","上货数量(支)(当月)");put("sign","16");}};
            HashMap map3 = new HashMap(){{put("title","下货数量(支)(当月)");put("sign","16");}};
            map.putAll(cabinetFormDao.queryExist(code, mainCabCode));//库存数量 不随时间变化
            map1.putAll(cabinetFormDao.queryOther(code, mainCabCode));//库存告警数量
            map2.putAll(cabinetFormDao.sellTopQueryUpNum(monthUtil().get(0), monthUtil().get(1),code,mainCabCode));//上货数量
            map3.putAll(cabinetFormDao.sellTopQueryDownNum(monthUtil().get(0), monthUtil().get(1),code,mainCabCode));//下货数量
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            return JsonResult.success("查询成功", list);
        }
        if (click==1){
            return JsonResult.success("查询成功",cabinetFormDao.queryCellQuantityClick(code, mainCabCode));
        }
        if (click==2){
                return JsonResult.success("查询成功",cabinetFormDao.queryAlarmClick(code, mainCabCode));
        }
        if (click==3){
                return JsonResult.success("查询成功",cabinetFormDao.queryUpNumClick(monthUtil().get(0), monthUtil().get(1),code,mainCabCode));
        }
        if (click==4){
                return JsonResult.success("查询成功",cabinetFormDao.queryDownNumClick(monthUtil().get(0), monthUtil().get(1),code,mainCabCode));
        }
        return JsonResult.fail("查询失败");
    }

    @Override
    public JsonResult sellFirstChart(String type, String startTime, String endTime, String other, String code, String mainCabCode) {
        HashMap hm1 = new HashMap();
        hm1.put("title","售刀柜刀具排名(产品属性)");
        List list1 = new ArrayList();
            if (other.equals("oldSpec")){//修改为按物料规格
                list1.addAll(cabinetFormDao.sellBarByOldSpec(code,mainCabCode));
            }else if(other.equals("skuCode")){
                list1.addAll(cabinetFormDao.sellBarBySkuCode(code,mainCabCode));
            }else if(other.equals("brand")){
                list1.addAll(cabinetFormDao.sellBarByBrand(code,mainCabCode));
            }else if(other.equals("type")){
                list1.addAll(cabinetFormDao.sellBarByType(code,mainCabCode));
            }else if(other.equals("category")){
                list1.addAll(cabinetFormDao.sellBarByCategory(code,mainCabCode));
            }
        hm1.put("data",list1);
        return JsonResult.success("查询成功",hm1);
    }

    @Override
    public JsonResult sellSecondChart(String type, String startTime, String endTime, String cabCode, String code, String mainCabCode) {
        HashMap hm2 = new HashMap();
        hm2.put("title","售刀柜刀具排名(柜子属性)");
        List list2 = new ArrayList();
            if (StringUtils.isNotBlank(cabCode)){
                list2.addAll(cabinetFormDao.sellBarBySpace(cabCode,code,mainCabCode));//一个柜子的货道
            }else{
                list2.addAll(cabinetFormDao.sellBarByCab(code,mainCabCode));//所有柜子
            }
        hm2.put("data",list2);
        return JsonResult.success("查询成功",hm2);
    }

    @Override
    public JsonResult list9(String type, String startTime, String endTime, int click, String code, String mainCabCode) {//存刀柜选项卡
        if (StringUtils.isNotBlank(type)&&click==0){//顶部数据  固定时间
            HashMap map = new HashMap(){{put("title","存刀柜库存数量(支)");put("sign","0");}};
            HashMap map1 = new HashMap(){{put("title","暂存刀具数量(支)");put("sign","0");}};
            HashMap map2 = new HashMap(){{put("title","报修数量(待盘验)(支)");put("sign","0");}};
            HashMap map3 = new HashMap(){{put("title","报废数量(待盘验)(支)");put("sign","0");}};
            HashMap map4 = new HashMap(){{put("title","空库位个数(个)");put("sign","5");}};
            //HashMap map5 = new HashMap(){{put("title","盘验缺失数量(支)");put("sign","0");}};
            //HashMap map6 = new HashMap(){{put("title","报修数量(已盘验)(支)");put("sign","0");}};
            //HashMap map7 = new HashMap(){{put("title","报废数量(已盘验)(支)");put("sign","0");}};
            map.putAll(cabinetFormDao.storeTopExist(code,mainCabCode));//存刀柜库存数量 不随时间变化
            map1.putAll(cabinetFormDao.storeTopOther(code,mainCabCode));//暂存刀具数量
            map2.putAll(cabinetFormDao.storeTopQueryRepairNum(code,mainCabCode));//报修数量待盘验
            map3.putAll(cabinetFormDao.storeTopQueryRecycleNum(code,mainCabCode));//报废数量待盘验
            map4.putAll(cabinetFormDao.storeTopQueryEmptyNum(code,mainCabCode));//空库位个数
            //map5.putAll(cabinetFormDao.storeTopQueryDefectNum(code));//盘验缺失数量
            //map6.putAll(cabinetFormDao.storeTopQueryRepairdNum(code));//报修数量已盘验
            //map7.putAll(cabinetFormDao.storeTopQueryRecycledNum(code));//报废数量已盘验
            List<HashMap> list = new ArrayList();
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            list.add(map4);
            //list.add(map5);
            //list.add(map6);
            //list.add(map7);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(type)&&click==1){
            return JsonResult.success("查询成功",cabinetFormDao.storeTopExistClick(code,mainCabCode));
        }
        if (click==2){
                return JsonResult.success("查询成功",cabinetFormDao.storeTopOtherClick(code,mainCabCode));
        }
        if (click==3){
                return JsonResult.success("查询成功",cabinetFormDao.storeTopQueryRepairNumClick(code,mainCabCode));
        }
        if (click==4){
                return JsonResult.success("查询成功",cabinetFormDao.storeTopQueryRecycleNumClick(code,mainCabCode));
        }
        if (click==5){
                return JsonResult.success("查询成功",cabinetFormDao.storeTopQueryEmptyNumClick(code,mainCabCode));
        }
       /* if (click==6){
                return JsonResult.success("查询成功",cabinetFormDao.storeTopQueryDefectNumClick(code,mainCabCode));
        }
        if (click==7){
                return JsonResult.success("查询成功",cabinetFormDao.storeTopQueryRepairdNumClick(code,mainCabCode));
        }
        if (click==8){
                return JsonResult.success("查询成功",cabinetFormDao.storeTopQueryRecycledNumClick(code,mainCabCode));
        }*/
        return JsonResult.fail("查询失败");
    }

    @Override
    public JsonResult storeFirstChart(String type, String startTime, String endTime, String other, String code, String mainCabCode) {
        HashMap hm1 = new HashMap();
        hm1.put("title","存刀柜刀具排名(产品属性)");
        List list1 = new ArrayList();
            if (other.equals("oldSpec")){//修改为按物料规格
                list1.addAll(cabinetFormDao.storeBarByOldSpec(code,mainCabCode));
            }else if(other.equals("skuCode")){
                list1.addAll(cabinetFormDao.storeBarBySkuCode(code,mainCabCode));
            }else if(other.equals("brand")){
                list1.addAll(cabinetFormDao.storeBarByBrand(code,mainCabCode));
            }else if(other.equals("type")){
                list1.addAll(cabinetFormDao.storeBarByType(code,mainCabCode));
            }else if(other.equals("category")){
                list1.addAll(cabinetFormDao.storeBarByCategory(code,mainCabCode));
            }
        hm1.put("data",list1);
        return JsonResult.success("查询成功",hm1);
    }

    @Override
    public JsonResult storeSecondChart(String type, String startTime, String endTime, String cabCode, String code, String mainCabCode) {
        HashMap hm2 = new HashMap();
        hm2.put("title","存刀柜刀具排名(柜子属性)");
        List list2 = new ArrayList();
            if (StringUtils.isNotBlank(cabCode)){
                list2.addAll(cabinetFormDao.storeBarBySpace(cabCode,code,mainCabCode));//一个柜子的货道
            }else{
                list2.addAll(cabinetFormDao.storeBarByCab(code,mainCabCode));//所有柜子
            }
        hm2.put("data",list2);
        return JsonResult.success("查询成功",hm2);
    }

    @Override
    public JsonResult storeThirdChart(String type, String startTime, String endTime, String other, String code, String mainCabCode) {
        HashMap hm3 = new HashMap();
        hm3.put("title","存刀柜刀具排名(按组织)");
        List list3 = new ArrayList();
            if (other.equals("person")){
                list3.addAll(cabinetFormDao.storeBarByPerson(code,mainCabCode));
            }else if(other.equals("device")){
                list3.addAll(cabinetFormDao.storeBarByDevice(code,mainCabCode));
            }else if(other.equals("dep")){
                list3.addAll(cabinetFormDao.storeBarByDep(code,mainCabCode));
            }
        hm3.put("data",list3);
        return JsonResult.success("查询成功",hm3);
    }

    @Override
    public JsonResult list0(String type, String startTime, String endTime, int click,String code) {//在用选项卡
        if (StringUtils.isNotBlank(type)&&click==0){//顶部数据  固定时间
            HashMap map = new HashMap(){{put("title","在用刀具数量(支)");put("sign","12");}};
            HashMap map1 = new HashMap(){{put("title","领取刀具数量(支)");put("sign","13");}};
            HashMap map2 = new HashMap(){{put("title","领新数量");put("sign","13");}};
            HashMap map3 = new HashMap(){{put("title","取刀数量");put("sign","13");}};
            HashMap map4 = new HashMap(){{put("title","归还刀具数量(支)");put("sign","13");}};
            HashMap map5 = new HashMap(){{put("title","暂存数量");put("sign","13");}};
            HashMap map6 = new HashMap(){{put("title","报修数量");put("sign","13");}};
            HashMap map7 = new HashMap(){{put("title","报废数量");put("sign","13");}};
            HashMap map8 = new HashMap(){{put("title","报失数量");put("sign","13");}};
                map.putAll(cabinetFormDao.useTopNow(code));//在用刀具数量
                map1.putAll(cabinetFormDao.useTopReceive(code));//领取刀具数量
                map2.putAll(cabinetFormDao.useTopReceiveNew(code));//领新数量
                map3.putAll(cabinetFormDao.useTopReceiveTake(code));//取刀数量
                map4.putAll(cabinetFormDao.useTopReturn(code));//归还刀具数量
                map5.putAll(cabinetFormDao.useTopReturnStaging(code));//暂存数量
                map6.putAll(cabinetFormDao.useTopReturnRepair(code));//报修数量
                map7.putAll(cabinetFormDao.useTopReturnRecycle(code));//报废数量
                map8.putAll(cabinetFormDao.useTopReturnLoss(code));//报失数量
            List<HashMap> list = new ArrayList();
            list.add(map);
            List<HashMap> list1 = new ArrayList();
            List<HashMap> list11 = new ArrayList();
            list11.add(map2);
            list11.add(map3);
            map1.put("sub",list11);
            list1.add(map1);
            List<HashMap> list2 = new ArrayList();
            List<HashMap> list21 = new ArrayList();
            list21.add(map5);
            list21.add(map6);
            list21.add(map7);
            list21.add(map8);
            map4.put("sub",list21);
            list2.add(map4);
            list.addAll(list1);
            list.addAll(list2);
            /*
            list.add(map);
            list.add(map1);
            list.add(map2);
            list.add(map3);
            list.add(map4);
            list.add(map5);
            list.add(map6);
            list.add(map7);
            list.add(map8);
            * */
            return JsonResult.success("查询成功", list);
        }
        if (click==1){
                return JsonResult.success("查询成功",cabinetFormDao.useTopNowClick(code));
        }
        if (click==2){
                return JsonResult.success("查询成功",cabinetFormDao.useTopReceiveNewClick(code));
        }
        if (click==3){
                return JsonResult.success("查询成功",cabinetFormDao.useTopReturnStagingClick(code));
        }
        if(click==4){
                return JsonResult.success("查询成功",cabinetFormDao.useTopReceiveNewRecClick(code));//领新
        }
        if(click==5){
                return JsonResult.success("查询成功",cabinetFormDao.useTopReceiveNewRetClick(code));//取刀
        }
        if(click==6){
                return JsonResult.success("查询成功",cabinetFormDao.useTopReturnStagingStoClick(code));//暂存
        }
        if(click==7){
                return JsonResult.success("查询成功",cabinetFormDao.useTopReturnStagingRepClick(code));//报修
        }
        if(click==8){
                return JsonResult.success("查询成功",cabinetFormDao.useTopReturnStagingScrClick(code));//报废
        }
        if(click==9){
            return JsonResult.success("查询成功",cabinetFormDao.useTopReturnStagingLossClick(code));//报失
        }
        return JsonResult.fail("查询失败");
    }

    @Override
    public JsonResult useFirstChart(String type, String startTime, String endTime, String other,String code) {
        HashMap hm1 = new HashMap();
        hm1.put("title","在用刀具排名(产品属性)");
        List list1 = new ArrayList();
            if (other.equals("oldSpec")){//修改为按物料规格
                list1.addAll(cabinetFormDao.useBarByOldSpec(code));
            }else if(other.equals("skuCode")){
                list1.addAll(cabinetFormDao.useBarBySkuCode(code));
            }else if(other.equals("brand")){
                list1.addAll(cabinetFormDao.useBarByBrand(code));
            }else if(other.equals("type")){
                list1.addAll(cabinetFormDao.useBarByType(code));
            }else if(other.equals("category")){
                list1.addAll(cabinetFormDao.useBarByCategory(code));
            }
        hm1.put("data",list1);
        return JsonResult.success("查询成功",hm1);
    }

    @Override
    public JsonResult useSecondChart(String type, String startTime, String endTime, String other,String code) {
        HashMap hm2 = new HashMap();
        hm2.put("title","在用刀具排名(按组织)");
        List list2 = new ArrayList();
            if (other.equals("person")){
                list2.addAll(cabinetFormDao.useBarByPerson(code));
            }else if(other.equals("device")){
                list2.addAll(cabinetFormDao.useBarByDevice(code));
            }else if(other.equals("dep")){
                list2.addAll(cabinetFormDao.useBarByDep(code));
            }
        hm2.put("data",list2);
        return JsonResult.success("查询成功",hm2);
    }

    @Override
    public JsonResult list11(String type, String startTime, String endTime, int click, String code) {
        if (StringUtils.isNotBlank(type)&&click==0){//顶部数据  固定时间
            HashMap map = new HashMap(){{put("title","报失道具数量(支)");put("sign","13");}};
            if (type.equals("0")){
                map.putAll(cabinetFormDao.lossTop(dayUtil().get(0),dayUtil().get(1),code));
            }else if (type.equals("1")){
                map.putAll(cabinetFormDao.lossTop(weekUtil().get(0),weekUtil().get(1),code));
            }else{
                map.putAll(cabinetFormDao.lossTop(dateUtil().get(0),dateUtil().get(1),code));
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==0){//顶部数据  指定时间
            HashMap map = new HashMap(){{put("title","报失道具数量(支)");put("sign","13");}};
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            map.putAll(cabinetFormDao.lossTop(start,end,code));
        }
        if (StringUtils.isNotBlank(type)&&click==1){//点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.lossTopClick(dayUtil().get(0),dayUtil().get(1),code));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.lossTopClick(weekUtil().get(0),weekUtil().get(1),code));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.lossTopClick(dateUtil().get(0),dateUtil().get(1),code));
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==1){//点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.lossTopClick(start,end,code));
        }
        return JsonResult.fail("查询失败");
    }

    @Override
    public JsonResult list12(String type, String dateType, String startTime, String endTime, int click, String code, String mainCabCode) {
        //获取时间
        dateTimeByDateType(dateType);

        List<HashMap> list = new ArrayList();

        HashMap map = new HashMap() {{
            put("title", "报失物料总数(支)");
            put("sign", "13");
        }};
        HashMap map1 = new HashMap() {{
            put("title", "报失物料总金额(元)");
            put("sign", "14");
        }};

        if (StringUtils.isNotBlank(type)&&click==0) {//顶部数据  固定时间

            if (type.equals("0")){
                map.putAll(cabinetFormDao.lossTopNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
                map1.putAll(cabinetFormDao.lossTopAmount(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                map.putAll(cabinetFormDao.lossTopNum(startWeekDateTime,endWeekDateTime,code,mainCabCode));
                map1.putAll(cabinetFormDao.lossTopAmount(startWeekDateTime,endWeekDateTime,code,mainCabCode));
            }else{
                map.putAll(cabinetFormDao.lossTopNum(startMonthDateTime,endMonthDateTime,code,mainCabCode));
                map1.putAll(cabinetFormDao.lossTopAmount(startMonthDateTime,endMonthDateTime,code,mainCabCode));
            }

            list.add(map);
            list.add(map1);
            return JsonResult.success("查询成功", list);
        }

        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==0){//顶部数据  指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");

            map.putAll(cabinetFormDao.lossTopNum(start,end,code,mainCabCode));
            map1.putAll(cabinetFormDao.lossTopAmount(start,end,code,mainCabCode));

            list.add(map);
            list.add(map1);
            return JsonResult.success("查询成功", list);
        }

        if (StringUtils.isNotBlank(type)&&click==1){//总数量点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.lossTopClickNum(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.lossTopClickNum(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.lossTopClickNum(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click==2){//总金额点击 固定时间
            if (type.equals("0")){
                return JsonResult.success("查询成功",cabinetFormDao.lossTopClickAmount(dayUtil().get(0),dayUtil().get(1),code,mainCabCode));
            }else if (type.equals("1")){
                return JsonResult.success("查询成功",cabinetFormDao.lossTopClickAmount(startWeekDateTime,endWeekDateTime,code, mainCabCode));
            }else{
                return JsonResult.success("查询成功",cabinetFormDao.lossTopClickAmount(startMonthDateTime,endMonthDateTime,code, mainCabCode));
            }
        }

        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==1){//总数量点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.lossTopClickNum(start,end,code,mainCabCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click==2){//总金额点击 指定时间
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功",cabinetFormDao.lossTopClickAmount(start,end,code,mainCabCode));
        }
        return JsonResult.fail("查询失败");
    }

    @Override
    public JsonResult lossFirstChart(String type, String startTime, String endTime, String other, String code) {
        HashMap hm1 = new HashMap();
        hm1.put("title","刀具报失情况(按产品)");
        List<HashMap> list1 = new ArrayList<>();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            if(other.equals("skuName")){
                list1.addAll(cabinetFormDao.queryLossBySkuName(start,end,code));//刀具报失情况按物料规格
            }else if(other.equals("type")){
                list1.addAll(cabinetFormDao.queryLossByTypeWeb(start,end,code));//刀具报失情况按类型
            }else if(other.equals("category")){
                list1.addAll(cabinetFormDao.queryLossByCategory(start,end,code));//刀具报失情况按分类
            }else if(other.equals("brand")){
                list1.addAll(cabinetFormDao.queryLossByBrand(start,end,code));//刀具报失情况按品牌
            }
        }
        if (type.equals("0")){
            if(other.equals("skuName")){
                list1.addAll(cabinetFormDao.queryLossBySkuName(dayUtil().get(0),dayUtil().get(1),code));//刀具报失情况按刀具sku名称
            }else if(other.equals("type")){
                list1.addAll(cabinetFormDao.queryLossByTypeWeb(dayUtil().get(0),dayUtil().get(1),code));//刀具报失情况按类型
            }else if(other.equals("category")){
                list1.addAll(cabinetFormDao.queryLossByCategory(dayUtil().get(0),dayUtil().get(1),code));//刀具报失情况按分类
            }else if(other.equals("brand")){
                list1.addAll(cabinetFormDao.queryLossByBrand(dayUtil().get(0),dayUtil().get(1),code));//刀具报失情况按品牌
            }
        }else if (type.equals("1")){
            if(other.equals("oldSpec")){
                list1.addAll(cabinetFormDao.queryLossBySkuName(weekUtil().get(0),weekUtil().get(1),code));//刀具消耗情况按刀具sku名称
            }else if(other.equals("type")){
                list1.addAll(cabinetFormDao.queryLossByTypeWeb(weekUtil().get(0),weekUtil().get(1),code));//刀具报失情况按类型
            }else if(other.equals("category")){
                list1.addAll(cabinetFormDao.queryLossByCategory(weekUtil().get(0),weekUtil().get(1),code));//刀具报失情况按分类
            }else if(other.equals("brand")){
                list1.addAll(cabinetFormDao.queryLossByBrand(weekUtil().get(0),weekUtil().get(1),code));//刀具报失情况按品牌
            }
        }else if (type.equals("2")){
            if(other.equals("oldSpec")){
                list1.addAll(cabinetFormDao.queryLossBySkuName(dateUtil().get(0),dateUtil().get(1),code));//刀具报失情况按刀具sku名称
            }else if(other.equals("type")){
                list1.addAll(cabinetFormDao.queryLossByTypeWeb(dateUtil().get(0),dateUtil().get(1),code));//刀具报失情况按类型
            }else if(other.equals("category")){
                list1.addAll(cabinetFormDao.queryLossByCategory(dateUtil().get(0),dateUtil().get(1),code));//刀具报失情况按分类
            }else if(other.equals("brand")){
                list1.addAll(cabinetFormDao.queryLossByBrand(dateUtil().get(0),dateUtil().get(1),code));//刀具报失情况按品牌
            }
        }
        hm1.put("data",list1);
        return JsonResult.success("查询成功",hm1);
    }

    @Override
    public JsonResult lossSecondChart(String type, String startTime, String endTime, String other, String code) {
        HashMap hm2 = new HashMap();
        hm2.put("title","刀具报失情况(按组织)");
        List list2 = new ArrayList();
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            if(other.equals("person")){
                list2.addAll(cabinetFormDao.queryLossByNameWeb(start,end,code));//刀具报失情况按人员
            }else if(other.equals("device")){
                list2.addAll(cabinetFormDao.queryLossByMachineWeb(start,end,code));//刀具报失情况按使用该设备的机床
            }else if(other.equals("dep")){
                list2.addAll(cabinetFormDao.queryLossByDep(start,end,code));//刀具报失情况按使用该设备的部门
            }
        }
        if (type.equals("0")){
            if(other.equals("person")){
                list2.addAll(cabinetFormDao.queryLossByNameWeb(dayUtil().get(0),dayUtil().get(1),code));//刀具报失情况按人员
            }else if(other.equals("device")){
                list2.addAll(cabinetFormDao.queryLossByMachineWeb(dayUtil().get(0),dayUtil().get(1),code));//刀具报失情况按使用该设备的机床
            }else if(other.equals("dep")){
                list2.addAll(cabinetFormDao.queryLossByDep(dayUtil().get(0),dayUtil().get(1),code));//刀具报失情况按使用该设备的部门
            }
        }else if (type.equals("1")){
            if(other.equals("person")){
                list2.addAll(cabinetFormDao.queryLossByNameWeb(weekUtil().get(0),weekUtil().get(1),code));//刀具报失情况按人员
            }else if(other.equals("device")){
                list2.addAll(cabinetFormDao.queryLossByMachineWeb(weekUtil().get(0),weekUtil().get(1),code));//刀具报失情况按使用该设备的机床
            }else if(other.equals("dep")){
                list2.addAll(cabinetFormDao.queryLossByDep(weekUtil().get(0),weekUtil().get(1),code));//刀具报失情况按使用该设备的部门
            }
        }else if (type.equals("2")){
            if(other.equals("person")){
                list2.addAll(cabinetFormDao.queryLossByNameWeb(dateUtil().get(0),dateUtil().get(1),code));//刀具报失情况按人员
            }else if(other.equals("device")){
                list2.addAll(cabinetFormDao.queryLossByMachineWeb(dateUtil().get(0),dateUtil().get(1),code));//刀具报失情况按使用该设备的机床
            }else if(other.equals("dep")){
                list2.addAll(cabinetFormDao.queryLossByDep(dateUtil().get(0),dateUtil().get(1),code));//刀具报失情况按使用该设备的部门
            }
        }
        hm2.put("data",list2);
        return JsonResult.success("查询成功",hm2);
    }

    @Override
    public PageResult data1(String type, String startTime, String endTime, Integer page, Integer limit, String sort, String order) {
        if(StringUtils.isNotBlank(type)){
            if (type.equals("0")){
                Page<CellInventoryInout> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort", StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("type",2);
                queryParam.put("startCreateTime",dayUtil().get(0).toString());
                queryParam.put("endCreateTime",dayUtil().get(1).toString());
                IPage<CellInventoryInoutVO> list = cellInventoryInoutService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else if (type.equals("1")){
                Page<CellInventoryInout> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort", StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("type",2);
                queryParam.put("startCreateTime",weekUtil().get(0).toString());
                queryParam.put("endCreateTime",weekUtil().get(1).toString());
                IPage<CellInventoryInoutVO> list = cellInventoryInoutService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else{
                Page<CellInventoryInout> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort", StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("type",2);
                queryParam.put("startCreateTime",dateUtil().get(0).toString());
                queryParam.put("endCreateTime",dateUtil().get(1).toString());
                IPage<CellInventoryInoutVO> list = cellInventoryInoutService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            Page<CellInventoryInout> pg = new Page<>(page, limit);
            Map queryParam=new HashMap();
            queryParam.put("sort", StrUtil.toUnderlineCase(sort));
            queryParam.put("order",order);
            queryParam.put("type",2);
            queryParam.put("startCreateTime",start.toString());
            queryParam.put("endCreateTime",end.toString());
            IPage<CellInventoryInoutVO> list = cellInventoryInoutService.pageList4app(pg,queryParam);
            return new PageResult<>(list.getRecords(), list.getTotal());
        }
        return null;
    }

    @Override
    public PageResult data2(String type, String startTime, String endTime, Integer page, Integer limit, String sort, String order) {
        if(StringUtils.isNotBlank(type)){
            if (type.equals("0")){
                Page<StorageInventoryInout> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("operationType",1);
                queryParam.put("startCreateTime",dayUtil().get(0).toString());
                queryParam.put("endCreateTime",dayUtil().get(1).toString());
                IPage<StorageInventoryInoutVO> list = storageInventoryInoutService.pageList(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else if (type.equals("1")){
                Page<StorageInventoryInout> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("operationType",1);
                queryParam.put("startCreateTime",weekUtil().get(0).toString());
                queryParam.put("endCreateTime",weekUtil().get(1).toString());
                IPage<StorageInventoryInoutVO> list = storageInventoryInoutService.pageList(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else{
                Page<StorageInventoryInout> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("operationType",1);
                queryParam.put("startCreateTime",dateUtil().get(0).toString());
                queryParam.put("endCreateTime",dateUtil().get(1).toString());
                IPage<StorageInventoryInoutVO> list = storageInventoryInoutService.pageList(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            Page<StorageInventoryInout> pg = new Page<>(page, limit);
            Map queryParam=new HashMap();
            queryParam.put("sort",StrUtil.toUnderlineCase(sort));
            queryParam.put("order",order);
            queryParam.put("operationType",1);
            queryParam.put("startCreateTime",start.toString());
            queryParam.put("endCreateTime",end.toString());
            IPage<StorageInventoryInoutVO> list = storageInventoryInoutService.pageList(pg,queryParam);
            return new PageResult<>(list.getRecords(), list.getTotal());
        }
        return null;
    }

    @Override
    public PageResult data3(String type, String startTime, String endTime, Integer page, Integer limit, String sort, String order) {
        if(StringUtils.isNotBlank(type)){
            if (type.equals("0")){
                Page<StorageInventoryInoutVO> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("operationType",2);
                queryParam.put("businessType",1);
                queryParam.put("startCreateTime",dayUtil().get(0).toString());
                queryParam.put("endCreateTime",dayUtil().get(1).toString());
                IPage<StorageInventoryInoutVO> list = storageInventoryInoutService.pageList(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else if (type.equals("1")){
                Page<StorageInventoryInoutVO> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("operationType",2);
                queryParam.put("businessType",1);
                queryParam.put("startCreateTime",weekUtil().get(0).toString());
                queryParam.put("endCreateTime",weekUtil().get(1).toString());
                IPage<StorageInventoryInoutVO> list = storageInventoryInoutService.pageList(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else{
                Page<StorageInventoryInoutVO> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("operationType",2);
                queryParam.put("businessDetailType",StorageInventoryInout.BusinessDetailType.tempOut.getValue());
                queryParam.put("businessType",1);
                queryParam.put("startCreateTime",dateUtil().get(0).toString());
                queryParam.put("endCreateTime",dateUtil().get(1).toString());
                IPage<StorageInventoryInoutVO> list = storageInventoryInoutService.pageList(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            Page<StorageInventoryInoutVO> pg = new Page<>(page, limit);
            Map queryParam=new HashMap();
            queryParam.put("sort",StrUtil.toUnderlineCase(sort));
            queryParam.put("order",order);
            queryParam.put("operationType",2);
            queryParam.put("businessType",1);
            queryParam.put("startCreateTime",start.toString());
            queryParam.put("endCreateTime",end.toString());
            IPage<StorageInventoryInoutVO> list = storageInventoryInoutService.pageList(pg,queryParam);
            return new PageResult<>(list.getRecords(), list.getTotal());
        }
        return null;
    }

    @Override
    public PageResult data4(String type, String startTime, String endTime, Integer page, Integer limit, String sort, String order) {
        if(StringUtils.isNotBlank(type)){
            if (type.equals("0")){
                Page<CheckedResult> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("startCreateTime",dayUtil().get(0).toString());
                queryParam.put("endCreateTime",dayUtil().get(1).toString());
                IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else if (type.equals("1")){
                Page<CheckedResult> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("startCreateTime",weekUtil().get(0).toString());
                queryParam.put("endCreateTime",weekUtil().get(1).toString());
                IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else{
                Page<CheckedResult> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("startCreateTime",dateUtil().get(0).toString());
                queryParam.put("endCreateTime",dateUtil().get(1).toString());
                IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            Page<CheckedResult> pg = new Page<>(page, limit);
            Map queryParam=new HashMap();
            queryParam.put("sort",StrUtil.toUnderlineCase(sort));
            queryParam.put("order",order);
            queryParam.put("startCreateTime",start.toString());
            queryParam.put("endCreateTime",end.toString());
            IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
            return new PageResult<>(list.getRecords(), list.getTotal());
        }
        return null;
    }

    @Override
    public PageResult data5(String type,String dateType, String startTime, String endTime, Integer page, Integer limit, String sort, String order) {
        //获取时间
        dateTimeByDateType(dateType);

        if(StringUtils.isNotBlank(type)){
            if (type.equals("0")){
                Page<CheckedResult> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("businessType",2);
                queryParam.put("startCreateTime",dayUtil().get(0).toString());
                queryParam.put("endCreateTime",dayUtil().get(1).toString());
                IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else if (type.equals("1")){
                Page<CheckedResult> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("businessType",2);
                queryParam.put("startCreateTime",startWeekDateTime.toString());
                queryParam.put("endCreateTime",endWeekDateTime.toString());
                IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else{
                Page<CheckedResult> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("businessType",2);
                queryParam.put("startCreateTime",startMonthDateTime.toString());
                queryParam.put("endCreateTime",endMonthDateTime.toString());
                IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            Page<CheckedResult> pg = new Page<>(page, limit);
            Map queryParam=new HashMap();
            queryParam.put("sort",StrUtil.toUnderlineCase(sort));
            queryParam.put("order",order);
            queryParam.put("businessType",2);
            queryParam.put("startCreateTime",start.toString());
            queryParam.put("endCreateTime",end.toString());
            IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
            return new PageResult<>(list.getRecords(), list.getTotal());
        }
        return null;
    }

    @Override
    public PageResult data6(String type, String dateType, String startTime, String endTime, Integer page, Integer limit, String sort, String order) {
        //获取时间
        dateTimeByDateType(dateType);

        if(StringUtils.isNotBlank(type)){
            if (type.equals("0")){
                Page<CheckedResult> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("businessType",3);
                queryParam.put("startCreateTime",dayUtil().get(0).toString());
                queryParam.put("endCreateTime",dayUtil().get(1).toString());
                IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else if (type.equals("1")){
                Page<CheckedResult> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("businessType",3);
                queryParam.put("startCreateTime",startWeekDateTime.toString());
                queryParam.put("endCreateTime",endWeekDateTime.toString());
                IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else{
                Page<CheckedResult> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("businessType",3);
                queryParam.put("startCreateTime",startMonthDateTime.toString());
                queryParam.put("endCreateTime",endMonthDateTime.toString());
                IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            Page<CheckedResult> pg = new Page<>(page, limit);
            Map queryParam=new HashMap();
            queryParam.put("sort",StrUtil.toUnderlineCase(sort));
            queryParam.put("order",order);
            queryParam.put("businessType",3);
            queryParam.put("startCreateTime",start.toString());
            queryParam.put("endCreateTime",end.toString());
            IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
            return new PageResult<>(list.getRecords(), list.getTotal());
        }
        return null;
    }

    @Override
    public PageResult data7(String type, String startTime, String endTime, Integer page, Integer limit, String sort, String order) {
        if(StringUtils.isNotBlank(type)){
            if (type.equals("0")){
                Page<CheckedResult> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("queryFlag","no");
                queryParam.put("startCreateTime",dayUtil().get(0).toString());
                queryParam.put("endCreateTime",dayUtil().get(1).toString());
                IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else if (type.equals("1")){
                Page<CheckedResult> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("queryFlag","no");
                queryParam.put("startCreateTime",weekUtil().get(0).toString());
                queryParam.put("endCreateTime",weekUtil().get(1).toString());
                IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else{
                Page<CheckedResult> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                queryParam.put("queryFlag","no");
                queryParam.put("startCreateTime",dateUtil().get(0).toString());
                queryParam.put("endCreateTime",dateUtil().get(1).toString());
                IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            Page<CheckedResult> pg = new Page<>(page, limit);
            Map queryParam=new HashMap();
            queryParam.put("sort",StrUtil.toUnderlineCase(sort));
            queryParam.put("order",order);
            queryParam.put("queryFlag","no");
            queryParam.put("startCreateTime",start.toString());
            queryParam.put("endCreateTime",end.toString());
            IPage<CheckedResultVO> list = checkedResultService.pageList4app(pg,queryParam);
            return new PageResult<>(list.getRecords(), list.getTotal());
        }
        return null;
    }

    @Override
    public PageResult data8(String type, String startTime, String endTime, Integer page, Integer limit, String sort, String order) {
        if(StringUtils.isNotBlank(type)){
            if (type.equals("0")){
                Page<CellInventorySpaceVO> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                //queryParam.put("startCreateTime",dayUtil().get(0).toString());
                //queryParam.put("endCreateTime",dayUtil().get(1).toString());
                IPage<CellInventorySpaceVO> list = cellInventorySpaceService.pageList(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else if (type.equals("1")){
                Page<CellInventorySpaceVO> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                //queryParam.put("startCreateTime",weekUtil().get(0).toString());
                //queryParam.put("endCreateTime",weekUtil().get(1).toString());
                IPage<CellInventorySpaceVO> list = cellInventorySpaceService.pageList(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else{
                Page<CellInventorySpaceVO> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                //queryParam.put("startCreateTime",dateUtil().get(0).toString());
                //queryParam.put("endCreateTime",dateUtil().get(1).toString());
                IPage<CellInventorySpaceVO> list = cellInventorySpaceService.pageList(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
           // LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            //LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            Page<CellInventorySpaceVO> pg = new Page<>(page, limit);
            Map queryParam=new HashMap();
            queryParam.put("sort",StrUtil.toUnderlineCase(sort));
            queryParam.put("order",order);
            //queryParam.put("startCreateTime",start.toString());
            //queryParam.put("endCreateTime",end.toString());
            IPage<CellInventorySpaceVO> list = cellInventorySpaceService.pageList(pg,queryParam);
            return new PageResult<>(list.getRecords(), list.getTotal());
        }
        return null;
    }

    @Override
    public PageResult data9(String type, String startTime, String endTime, Integer page, Integer limit, String sort, String order) {
        if(StringUtils.isNotBlank(type)){
            if (type.equals("0")){
                Page<StorageInventorySpaceVO> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                //queryParam.put("startCreateTime",dayUtil().get(0).toString());
                //queryParam.put("endCreateTime",dayUtil().get(1).toString());
                IPage<StorageInventorySpaceVO> list = storageInventorySpaceService.pageList(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else if (type.equals("1")){
                Page<StorageInventorySpaceVO> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                //queryParam.put("startCreateTime",weekUtil().get(0).toString());
                //queryParam.put("endCreateTime",weekUtil().get(1).toString());
                IPage<StorageInventorySpaceVO> list = storageInventorySpaceService.pageList(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else{
                Page<StorageInventorySpaceVO> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                //queryParam.put("startCreateTime",dateUtil().get(0).toString());
                //queryParam.put("endCreateTime",dateUtil().get(1).toString());
                IPage<StorageInventorySpaceVO> list = storageInventorySpaceService.pageList(pg,queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            //LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            //LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            Page<StorageInventorySpaceVO> pg = new Page<>(page, limit);
            Map queryParam=new HashMap();
            queryParam.put("sort",StrUtil.toUnderlineCase(sort));
            queryParam.put("order",order);
            //queryParam.put("startCreateTime",start.toString());
            //queryParam.put("endCreateTime",end.toString());
            IPage<StorageInventorySpaceVO> list = storageInventorySpaceService.pageList(pg,queryParam);
            return new PageResult<>(list.getRecords(), list.getTotal());
        }
        return null;
    }

    @Override
    public PageResult data0(String type, String startTime, String endTime, Integer page, Integer limit, String sort, String order) {
        if(StringUtils.isNotBlank(type)){
            if (type.equals("0")){
                Page<UseInventoryProductVO> pg = new Page<>(page, limit);
                Map<String, Object> queryParam = new HashMap<>();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                //queryParam.put("startCreateTime",dayUtil().get(0).toString());
                //queryParam.put("endCreateTime",dayUtil().get(1).toString());
                Page<UseInventoryUserVO> list = useInventoryUserService.pageList4app(pg, queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else if (type.equals("1")){
                Page<UseInventoryProductVO> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                //queryParam.put("startCreateTime",weekUtil().get(0).toString());
                //queryParam.put("endCreateTime",weekUtil().get(1).toString());
                Page<UseInventoryUserVO> list = useInventoryUserService.pageList4app(pg, queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }else{
                Page<UseInventoryProductVO> pg = new Page<>(page, limit);
                Map queryParam=new HashMap();
                queryParam.put("sort",StrUtil.toUnderlineCase(sort));
                queryParam.put("order",order);
                //queryParam.put("startCreateTime",dateUtil().get(0).toString());
                //queryParam.put("endCreateTime",dateUtil().get(1).toString());
                Page<UseInventoryUserVO> list = useInventoryUserService.pageList4app(pg, queryParam);
                return new PageResult<>(list.getRecords(), list.getTotal());
            }
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            //LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            //LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            Page<UseInventoryProductVO> pg = new Page<>(page, limit);
            Map queryParam=new HashMap();
            queryParam.put("sort",StrUtil.toUnderlineCase(sort));
            queryParam.put("order",order);
            //queryParam.put("startCreateTime",start.toString());
            //queryParam.put("endCreateTime",end.toString());
            Page<UseInventoryUserVO> list = useInventoryUserService.pageList4app(pg, queryParam);
            return new PageResult<>(list.getRecords(), list.getTotal());
        }
        return null;
    }


/*    public static List startPage(List list, Integer pageNum, Integer pageSize) {
        if(list == null||list.size() == 0){
            return null;
        }
        Integer count = list.size(); //记录总数
        Integer pageCount = 0; //页数
        if (count % pageSize == 0) {
            pageCount = count / pageSize;
        } else {
            pageCount = count / pageSize + 1;
        }

        int fromIndex = 0; //开始索引
        int toIndex = 0; //结束索引

        if(pageNum > pageCount){
            pageNum = pageCount;
        }
        if (!pageNum.equals(pageCount)) {
            fromIndex = (pageNum - 1) * pageSize;
            toIndex = fromIndex + pageSize;
        } else {
            fromIndex = (pageNum - 1) * pageSize;
            toIndex = count;
        }

        return list.subList(fromIndex, toIndex);
    }*/

    //当前时间往前推一个月
    public static List<LocalDateTime> dateUtil() {//当天开始时间00 00 00 到 23 59 59
        LocalDateTime first = LocalDateTime.of(LocalDate.now().plusMonths(-1), LocalTime.MIN);
        LocalDateTime last = LocalDateTime.of(LocalDate.now(), LocalTime.MAX);
        List list = new ArrayList<>();
        list.add(first);
        list.add(last);
        return list;
    }
    //当前时间往前推一周
    public static List<LocalDateTime> weekUtil() {//当天开始时间00 00 00 到 23 59 59
        LocalDateTime first = LocalDateTime.of(LocalDate.now().plusWeeks(-1), LocalTime.MIN);
        LocalDateTime last = LocalDateTime.of(LocalDate.now(), LocalTime.MAX);
        List list = new ArrayList<>();
        list.add(first);
        list.add(last);
        return list;
    }
    //当天
    public static List<LocalDateTime> dayUtil() {//当天开始时间00 00 00 到 23 59 59
        LocalDateTime first = LocalDateTime.of(LocalDate.now(), LocalTime.MIN);
        LocalDateTime last = LocalDateTime.of(LocalDate.now(), LocalTime.MAX);
        List list = new ArrayList<>();
        list.add(first);
        list.add(last);
        return list;
    }

    //当月
    public static List<LocalDateTime> monthUtil() {//开始时间00 00 00 到 23 59 59
        LocalDateTime first = LocalDateTime.of(LocalDate.now().with(TemporalAdjusters.firstDayOfMonth()), LocalTime.MIN);
        LocalDateTime last = LocalDateTime.of(LocalDate.now(), LocalTime.MAX);
        List list = new ArrayList<>();
        list.add(first);
        list.add(last);
        return list;
    }


    //pc止

    //app开始 //近30日1周2月

    @Override
    public HashMap queryNewInfo(String code) {
        return cabinetFormDao.queryNewApp(dayUtil().get(0),dayUtil().get(1),code);
    }

    @Override
    public HashMap queryNewTwo(String type,String code) {
        if (type.equals("0")){
            return cabinetFormDao.queryNewTwo(dateUtil().get(0),dateUtil().get(1),code);
        }else if (type.equals("1")){
            return cabinetFormDao.queryNewTwo(weekUtil().get(0),weekUtil().get(1),code);
        }else if (type.equals("2")){
            return cabinetFormDao.queryNewTwo(monthUtil().get(0),monthUtil().get(1),code);
        }else{
            return cabinetFormDao.queryNewTwo(dayUtil().get(0),monthUtil().get(1),code);
        }
    }

    @Override
    public HashMap queryExistInfo(Integer categoryType) {
        if(null == categoryType){
           categoryType = ProductCategory.CategoryType.purchase.getValue();
        }
        return cabinetFormDao.queryExistApp(categoryType);
    }

    @Override
    public HashMap queryOtherInfo(String type,String code) {
        if (type.equals("0")){ //近30天
            return cabinetFormDao.queryOtherApp(dateUtil().get(0),dateUtil().get(1),code);
        }else if (type.equals("1")){  //七天
            return cabinetFormDao.queryOtherApp(weekUtil().get(0),weekUtil().get(1),code);
        }else if (type.equals("2")){ //本月
            return cabinetFormDao.queryOtherApp(monthUtil().get(0),monthUtil().get(1),code);
        }else{//今日
            return cabinetFormDao.queryOtherApp(dayUtil().get(0),monthUtil().get(1),code);
        }
    }

    @Override
    public HashMap queryInNum(String type,String code) {
        if (type.equals("0")){
            return cabinetFormDao.queryInNum(dateUtil().get(0),dateUtil().get(1),code);
        }else if (type.equals("1")){
            return cabinetFormDao.queryInNum(weekUtil().get(0),weekUtil().get(1),code);
        }else if (type.equals("2")){
            return cabinetFormDao.queryInNum(monthUtil().get(0),monthUtil().get(1),code);
        }else{
            return cabinetFormDao.queryInNum(dayUtil().get(0),monthUtil().get(1),code);
        }
    }

    @Override
    public List<HashMap> queryCabinetByNameInfo(String type,String code) {
        if (type.equals("0")){
            return cabinetFormDao.queryCabinetByName(dateUtil().get(0),dateUtil().get(1),code);
        }else if (type.equals("1")){
            return cabinetFormDao.queryCabinetByName(weekUtil().get(0),weekUtil().get(1),code);
        }else if (type.equals("2")){
            return cabinetFormDao.queryCabinetByName(monthUtil().get(0),monthUtil().get(1),code);
        }else{
            return cabinetFormDao.queryCabinetByName(dayUtil().get(0),monthUtil().get(1),code);
        }
    }

    @Override
    public List<HashMap> queryCabinetByTypeInfo(String type,String code) {
        if (type.equals("0")){
            return cabinetFormDao.queryCabinetByType(dateUtil().get(0),dateUtil().get(1),code);
        }else if (type.equals("1")){
            return cabinetFormDao.queryCabinetByType(weekUtil().get(0),weekUtil().get(1),code);
        }else if (type.equals("2")){
            return cabinetFormDao.queryCabinetByType(monthUtil().get(0),monthUtil().get(1),code);
        }else{
            return cabinetFormDao.queryCabinetByType(dayUtil().get(0),monthUtil().get(1),code);
        }
    }

    @Override
    public List<HashMap> queryCabinetByMachineInfo(String type,String code) {
        if (type.equals("0")){
            return cabinetFormDao.queryCabinetByMachine(dateUtil().get(0),dateUtil().get(1),code);
        }else if (type.equals("1")){
            return cabinetFormDao.queryCabinetByMachine(weekUtil().get(0),weekUtil().get(1),code);
        }else if (type.equals("2")){
            return cabinetFormDao.queryCabinetByMachine(monthUtil().get(0),monthUtil().get(1),code);
        }else{
            return cabinetFormDao.queryCabinetByMachine(dayUtil().get(0),monthUtil().get(1),code);
        }
    }

    @Override
    public JsonResult storeFourChart(String type, String enterpriseCode) {
        Calendar calendar = Calendar.getInstance();
        // 获取当前年
        int year = calendar.get(Calendar.YEAR);
        List<BrandLifeVO> lifeVOList = Arrays.asList();
        Map<String, Object> params = new HashMap<>();
        params.put("enterpriseCode", JwtUtils.getEnterpriseCode());
        if(type.equals("0")){//当前月份
            params.put("startCreateTime",FindDateStatusUtil.getMonthStartTime());
            params.put("endCreateTime",FindDateStatusUtil.getMonthEndTime());
            lifeVOList = brandLifeService.list4app(params);
        }else if(type.equals("1")){//1月份
            String date = year+"-01-02";
            params.put("startCreateTime",FindDateStatusUtil.getFirstOfMonth(date));
            params.put("endCreateTime",FindDateStatusUtil.getLastOfMonth(date));
            lifeVOList = brandLifeService.list4app(params);
        }else if(type.equals("2")){//2月份
            String date = year+"-02-02";
            params.put("startCreateTime",FindDateStatusUtil.getFirstOfMonth(date));
            params.put("endCreateTime",FindDateStatusUtil.getLastOfMonth(date));
            lifeVOList = brandLifeService.list4app(params);
        }else if(type.equals("3")){//3月份
            String date = year+"-01-02";
            params.put("startCreateTime",FindDateStatusUtil.getFirstOfMonth(date));
            params.put("endCreateTime",FindDateStatusUtil.getLastOfMonth(date));
            lifeVOList = brandLifeService.list4app(params);
        }else if(type.equals("4")){//4月份
            String date = year+"-04-02";
            params.put("startCreateTime",FindDateStatusUtil.getFirstOfMonth(date));
            params.put("endCreateTime",FindDateStatusUtil.getLastOfMonth(date));
            lifeVOList = brandLifeService.list4app(params);
        }else if(type.equals("5")){//5月份
            String date = year+"-05-02";
            params.put("startCreateTime",FindDateStatusUtil.getFirstOfMonth(date));
            params.put("endCreateTime",FindDateStatusUtil.getLastOfMonth(date));
            lifeVOList = brandLifeService.list4app(params);
        }else if(type.equals("6")){//6月份
            String date = year+"-06-02";
            params.put("startCreateTime",FindDateStatusUtil.getFirstOfMonth(date));
            params.put("endCreateTime",FindDateStatusUtil.getLastOfMonth(date));
            lifeVOList = brandLifeService.list4app(params);
        }else if(type.equals("7")){//7月份
            String date = year+"-07-02";
            params.put("startCreateTime",FindDateStatusUtil.getFirstOfMonth(date));
            params.put("endCreateTime",FindDateStatusUtil.getLastOfMonth(date));
            lifeVOList = brandLifeService.list4app(params);
        }else if(type.equals("8")){//8月份
            String date = year+"-08-02";
            params.put("startCreateTime",FindDateStatusUtil.getFirstOfMonth(date));
            params.put("endCreateTime",FindDateStatusUtil.getLastOfMonth(date));
            lifeVOList = brandLifeService.list4app(params);
        }else if(type.equals("9")){//9份
            String date = year+"-09-02";
            params.put("startCreateTime",FindDateStatusUtil.getFirstOfMonth(date));
            params.put("endCreateTime",FindDateStatusUtil.getLastOfMonth(date));
            lifeVOList = brandLifeService.list4app(params);
        }else if(type.equals("10")){//10月份
            String date = year+"-10-02";
            params.put("startCreateTime",FindDateStatusUtil.getFirstOfMonth(date));
            params.put("endCreateTime",FindDateStatusUtil.getLastOfMonth(date));
            lifeVOList = brandLifeService.list4app(params);
        }else if(type.equals("11")){//11月份
            String date = year+"-11-02";
            params.put("startCreateTime",FindDateStatusUtil.getFirstOfMonth(date));
            params.put("endCreateTime",FindDateStatusUtil.getLastOfMonth(date));
            lifeVOList = brandLifeService.list4app(params);
        }else if(type.equals("12")){//12月份
            String date = year+"-12-02";
            params.put("startCreateTime",FindDateStatusUtil.getFirstOfMonth(date));
            params.put("endCreateTime",FindDateStatusUtil.getLastOfMonth(date));
            lifeVOList = brandLifeService.list4app(params);
        }
        HashMap map = new HashMap();
        map.put("title","品牌生命周期达成率");
        map.put("data",lifeVOList);
        return JsonResult.success("查询成功",map);
    }

    @Override
    public JsonResult queryFirstCabinetTop(String enterpriseCode) {
        //String enterpriseCode = JwtUtils.getEnterpriseCode();
        HashMap map1 = new HashMap(){{put("title","领新(最小单位)");}};
        HashMap map2 = new HashMap(){{put("title","暂存(最小单位)");}};
        HashMap map3 = new HashMap(){{put("title","在用未归还(最小单位)");}};
        //HashMap map3 = new HashMap(){{put("title","维修");}};
        //HashMap map4 = new HashMap(){{put("title","报废");}};
        map1.put("data",cabinetFormDao.queryCabinetTopAmount(FindDateStatusUtil.monthUtil().get(0),FindDateStatusUtil.monthUtil().get(1),enterpriseCode));
        map2.put("data",cabinetFormDao.queryCabinetTopAmounts(FindDateStatusUtil.monthUtil().get(0),FindDateStatusUtil.monthUtil().get(1),1,enterpriseCode));
        map3.put("data",cabinetFormDao.queryFirstCabinetTopUnreturn(enterpriseCode));
        //map3.put("data",cabinetFormDao.queryCabinetTopAmounts(FindDateStatusUtil.dateUtil().get(0),FindDateStatusUtil.dateUtil().get(1),2,enterpriseCode));
        //map4.put("data",cabinetFormDao.queryCabinetTopAmounts(FindDateStatusUtil.dateUtil().get(0),FindDateStatusUtil.dateUtil().get(1),3,enterpriseCode));
        List list = new ArrayList();
        list.add(map1);
        list.add(map2);
        list.add(map3);
        //list.add(map4);
        return JsonResult.success("查询成功", list);
    }

    @Override
    public JsonResult queryFirstCabinetMiddle(String enterpriseCode) {
        //String enterpriseCode = JwtUtils.getEnterpriseCode();
        /*HashMap map1 = new HashMap(){{put("title","领新");}};
        HashMap map2 = new HashMap(){{put("title","在用未归还");}};
        HashMap map3 = new HashMap(){{put("title","维修");}};
        HashMap map4 = new HashMap(){{put("title","报废");}};
        map1.put("data",cabinetFormDao.queryCabinetMiddleNeckRanking(FindDateStatusUtil.dateUtil().get(0),FindDateStatusUtil.dateUtil().get(1),enterpriseCode));
        map2.put("data",cabinetFormDao.findNotReturnedInUse(enterpriseCode));
        map3.put("data",cabinetFormDao.queryCabinetMiddleTempRanking(FindDateStatusUtil.dateUtil().get(0),FindDateStatusUtil.dateUtil().get(1),enterpriseCode,2));
        map4.put("data",cabinetFormDao.queryCabinetMiddleTempRanking(FindDateStatusUtil.dateUtil().get(0),FindDateStatusUtil.dateUtil().get(1),enterpriseCode,3));
        List list = new ArrayList();
        list.add(map1);
        list.add(map2);
        list.add(map3);
        list.add(map4);*/
        HashMap map1 = new HashMap(){{put("title","领新(按物料)");}};
        HashMap map2 = new HashMap(){{put("title","在用未归还(按人)");}};
        map1.put("data",cabinetFormDao.queryFirstCabinetMiddleOne(FindDateStatusUtil.monthUtil().get(0),FindDateStatusUtil.monthUtil().get(1),enterpriseCode));
        map2.put("data",cabinetFormDao.queryFirstCabinetMiddleTwo(enterpriseCode));
        List list = new ArrayList();
        list.add(map1);
        list.add(map2);
        return JsonResult.success("查询成功", list);
    }

    @Override
    public JsonResult querySecondCabinetBoard(String type, String  createTime,String enterpriseCode) {
        HashMap map = new HashMap(){};
        // type: 1 今日数据  2  本周数据  3 本月数据
        if(StringUtils.isNotBlank(type)){
            Map<String, Object> params = new HashMap<>();
            params.put("type",type);
            params.put("enterpriseCode",enterpriseCode);
            if(type.equals("1")){
                params.put("start",ReportUtil.dayUtil().get(0));
                params.put("end",ReportUtil.dayUtil().get(1));
                //昨天的日期
                params.put("startOld",ReportUtil.yesterday().get(0));
                params.put("endOld",ReportUtil.yesterday().get(1));
                //今日领新
                map.put("toolWear",cabinetFormDao.queryCutterConsumes(params));
                //今日消耗
                //map.put("amountConsumed",cabinetFormDao.queryCutterAmount(params));
                //今日维修
                map.put("cutterMaintain",cabinetFormDao.queryCutterMaintain(params));
                //今日报废
                map.put("cutterScrap",cabinetFormDao.queryCutterScrap(params));
            }else if(type.equals("2")){
                params.put("start",ReportUtil.thisWeekUtil().get(0));
                params.put("end",ReportUtil.thisWeekUtil().get(1));
                //上一周的日期
                params.put("startOld",ReportUtil.weekOld().get(0));
                params.put("endOld",ReportUtil.weekOld().get(1));
                //今日领新
                map.put("toolWear",cabinetFormDao.queryCutterConsumes(params));
                //今日消耗
                //map.put("amountConsumed",cabinetFormDao.queryCutterAmount(params));
                //今日维修
                map.put("cutterMaintain",cabinetFormDao.queryCutterMaintain(params));
                //今日报废
                map.put("cutterScrap",cabinetFormDao.queryCutterScrap(params));
            }else if(type.equals("3")){
                params.put("start",ReportUtil.monthUtil().get(0));
                params.put("end",ReportUtil.monthUtil().get(1));
                //上一月的日期
                params.put("startOld",ReportUtil.dateUtilOld().get(0));
                params.put("endOld",ReportUtil.dateUtilOld().get(1));
                //今日领新
                map.put("toolWear",cabinetFormDao.queryCutterConsumes(params));
                //今日消耗
                //map.put("amountConsumed",cabinetFormDao.queryCutterAmount(params));
                //今日维修
                map.put("cutterMaintain",cabinetFormDao.queryCutterMaintain(params));
                //今日报废
                map.put("cutterScrap",cabinetFormDao.queryCutterScrap(params));
            }
            //在库刀柜数量（支）
            map.put("inCabinetNumber",cabinetFormDao.queryInCabinetNumber(params));
            //在库刀柜价值（支）
            //map.put("inCabinetValue",cabinetFormDao.statisticalInCabinetValue(params));
            //库存警告数（条）
            map.put("stockWarnedNumber",cabinetFormDao.queryStockWarnedNumber(params));
            //盘验任务数（个）
            map.put("surveyTaskNumber",cabinetFormDao.querySurveyTaskNumber(params));
            //库存告警
            map.put("stockWarnedList",cabinetFormDao.queryStockWarned(params));
            return JsonResult.success("查询成功", map);
        }
        if(StringUtils.isNotBlank(createTime)){
            //获取上一天的日期
            Map<String, Object> params = new HashMap<>();
            params.put("start",ReportUtil.oneDay(createTime).get(0));
            params.put("end",ReportUtil.oneDay(createTime).get(1));
            //上一月的日期
            params.put("startOld",ReportUtil.oneDayOld(createTime).get(0));
            params.put("endOld",ReportUtil.oneDayOld(createTime).get(1));
            params.put("enterpriseCode",enterpriseCode);
            map.put("toolWear",cabinetFormDao.queryCutterConsumes(params));//今日消耗（刀具）
            map.put("cutterMaintain",cabinetFormDao.queryCutterMaintain(params));//今日维修（刀具）
            map.put("cutterScrap",cabinetFormDao.queryCutterScrap(params));//今日报废（刀具）
            //map.put("amountConsumed",cabinetFormDao.queryCutterAmount(params));//今日消耗（金额）
            map.put("inCabinetNumber",cabinetFormDao.queryInCabinetNumber(params));//在库刀柜数量（支）
            //map.put("inCabinetValue",cabinetFormDao.statisticalInCabinetValue(params));//在库刀柜价值（支）
            map.put("stockWarnedNumber",cabinetFormDao.queryStockWarnedNumber(params));//库存警告数（条）
            map.put("surveyTaskNumber",cabinetFormDao.querySurveyTaskNumber(params));//盘验任务数（个）
            map.put("stockWarnedList",cabinetFormDao.queryStockWarned(params));//库存告警
            return JsonResult.success("查询成功", map);
        }
        return JsonResult.fail();
    }

    @Override
    public JsonResult queryCabinetStatistics(String type, String click, String startTime, String endTime,String mainCabCode) {
        List list = new ArrayList();
        String enterpriseCode = JwtUtils.getEnterpriseCode();
        HashMap map1 = new HashMap(){{put("title","领新数量（支）");put("sign","10");}};
        HashMap map2 = new HashMap(){{put("title","领新金额（元）");put("sign","15");}};
        HashMap map3 = new HashMap(){{put("title","主柜数量（个）");put("sign","31");}};
        if (StringUtils.isNotBlank(type)&&click.equals("0")) {//顶部数据  固定时间
            if (type.equals("0")){
                map1.put("data",cabinetFormDao.findCabinetRequisitionNumber(dayUtil().get(0),dayUtil().get(1),enterpriseCode,mainCabCode));
                map2.put("data",cabinetFormDao.findCabinetRequisitionMoney(dayUtil().get(0),dayUtil().get(1),enterpriseCode,mainCabCode));
            }else if(type.equals("1")){
                map1.put("data",cabinetFormDao.findCabinetRequisitionNumber(weekUtil().get(0),weekUtil().get(1),enterpriseCode,mainCabCode));
                map2.put("data",cabinetFormDao.findCabinetRequisitionMoney(weekUtil().get(0),weekUtil().get(1),enterpriseCode,mainCabCode));
            }else if(type.equals("2")){
                map1.put("data",cabinetFormDao.findCabinetRequisitionNumber(dateUtil().get(0),dateUtil().get(1),enterpriseCode,mainCabCode));
                map2.put("data",cabinetFormDao.findCabinetRequisitionMoney(dateUtil().get(0),dateUtil().get(1),enterpriseCode,mainCabCode));
            }
            map3.put("data",cabinetFormDao.findCabinetNumber(enterpriseCode));
            list.add(map1);
            list.add(map2);
            list.add(map3);
            return JsonResult.success("查询成功", list);
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click.equals("0")){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            map1.put("data",cabinetFormDao.findCabinetRequisitionNumber(start,end,enterpriseCode,mainCabCode));
            map2.put("data",cabinetFormDao.findCabinetRequisitionMoney(start,end,enterpriseCode,mainCabCode));
            map3.put("data",cabinetFormDao.findCabinetNumber(enterpriseCode));
            return JsonResult.success("查询成功", list);
        }
        //点击  日周月查询
        if (StringUtils.isNotBlank(type)&&(click.equals("1")||click.equals("2"))){
            if(type.equals("0")){
                return JsonResult.success("查询成功", cabinetFormDao.findMasterAmountClick(dayUtil().get(0),dayUtil().get(1),enterpriseCode));
            }else if(type.equals("1")){
                return JsonResult.success("查询成功", cabinetFormDao.findMasterAmountClick(weekUtil().get(0),weekUtil().get(1),enterpriseCode));
            }else if(type.equals("2")){
                return JsonResult.success("查询成功", cabinetFormDao.findMasterAmountClick(dateUtil().get(0),dateUtil().get(1),enterpriseCode));
            }
        }
        if (StringUtils.isNotBlank(type)&&click.equals("3")){
            return JsonResult.success("查询成功", cabinetFormDao.findMasterCabinet(enterpriseCode));
        }
        // 点击按时间区间查询
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&(click.equals("1")||click.equals("2"))){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            return JsonResult.success("查询成功", cabinetFormDao.findMasterAmountClick(start,end,enterpriseCode));
        }
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&click.equals("3")){
            return JsonResult.success("查询成功", cabinetFormDao.findMasterCabinet(enterpriseCode));
        }
        return JsonResult.fail();
    }

    @Override
    public JsonResult queryCabinetConsume(String type, String startTime, String endTime,String mainCabCode) {
        String enterpriseCode = JwtUtils.getEnterpriseCode();
        HashMap map = new HashMap(){{put("title","刀具消耗数量");}};
        if(StringUtils.isNotBlank(type)&&StringUtils.isBlank(mainCabCode)){
            if(type.equals("0")){
                map.put("data",cabinetFormDao.findCabinetExpendNumber(dayUtil().get(0),dayUtil().get(1),enterpriseCode));
            }else if(type.equals("1")){
                map.put("data",cabinetFormDao.findCabinetExpendNumber(weekUtil().get(0),weekUtil().get(1),enterpriseCode));
            }else if(type.equals("2")){
                map.put("data",cabinetFormDao.findCabinetExpendNumber(dateUtil().get(0),dateUtil().get(1),enterpriseCode));
            }
            return JsonResult.success("查询成功", map);
        }
        if(StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            map.put("data",cabinetFormDao.findCabinetExpendNumber(start,end,enterpriseCode));
            return JsonResult.success("查询成功", map);
        }
        if(StringUtils.isNotBlank(mainCabCode)&&StringUtils.isNotBlank(type)) {
            Map<String, Object> params = new HashMap<>();
            params.put("enterpriseCode",JwtUtils.getEnterpriseCode());
            params.put("mainCabCode",mainCabCode);
            if(type.equals("0")){
                params.put("begin",dayUtil().get(0));
                params.put("end",dayUtil().get(1));
            }else if(type.equals("1")){
                params.put("begin",weekUtil().get(0));
                params.put("end",weekUtil().get(1));
            }else if(type.equals("2")){
                params.put("begin",dateUtil().get(0));
                params.put("end",dateUtil().get(1));
            }
            map.put("data",cabinetFormDao.findProductByMainCabCode(params));
            return JsonResult.success("查询成功", map);
        }
        if(StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&StringUtils.isNotBlank(mainCabCode)){
            Map<String, Object> params = new HashMap<>();
            params.put("enterpriseCode",JwtUtils.getEnterpriseCode());
            params.put("mainCabCode",mainCabCode);
            params.put("begin",startTime);
            params.put("end",endTime);
            map.put("data",cabinetFormDao.findProductByMainCabCode(params));
            return JsonResult.success("查询成功", map);
        }
        return JsonResult.fail();
    }

    @Override
    public JsonResult queryCabinetMoney(String type, String startTime, String endTime,String mainCabCode) {
        String enterpriseCode = JwtUtils.getEnterpriseCode();
        HashMap map = new HashMap(){{put("title","刀具消耗金额");}};
        if(StringUtils.isNotBlank(type)&&StringUtils.isBlank(mainCabCode)){
            if(type.equals("0")){
                map.put("data",cabinetFormDao.findCabinetExpendMoney(dayUtil().get(0),dayUtil().get(1),enterpriseCode));
                map.put("sum",cabinetFormDao.findCabinetRequisitionMoney(dayUtil().get(0),dayUtil().get(1),enterpriseCode,mainCabCode));
            }else if(type.equals("1")){
                map.put("data",cabinetFormDao.findCabinetExpendMoney(weekUtil().get(0),weekUtil().get(1),enterpriseCode));
                map.put("sum",cabinetFormDao.findCabinetRequisitionMoney(weekUtil().get(0),weekUtil().get(1),enterpriseCode,mainCabCode));
            }else if(type.equals("2")){
                map.put("data",cabinetFormDao.findCabinetExpendMoney(dateUtil().get(0),dateUtil().get(1),enterpriseCode));
                map.put("sum",cabinetFormDao.findCabinetRequisitionMoney(dateUtil().get(0),dateUtil().get(1),enterpriseCode,mainCabCode));
            }
            return JsonResult.success("查询成功", map);
        }
        if(StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&StringUtils.isBlank(mainCabCode)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            map.put("data",cabinetFormDao.findCabinetExpendMoney(start,end,enterpriseCode));
            map.put("sum",cabinetFormDao.findCabinetRequisitionMoney(start,end,enterpriseCode,mainCabCode));
            return JsonResult.success("查询成功", map);
        }
        if(StringUtils.isNotBlank(mainCabCode)&&StringUtils.isNotBlank(type)) {
            Map<String, Object> params = new HashMap<>();
            params.put("enterpriseCode",JwtUtils.getEnterpriseCode());
            params.put("mainCabCode",mainCabCode);
            if(type.equals("0")){
                params.put("begin",dayUtil().get(0));
                params.put("end",dayUtil().get(1));
            }else if(type.equals("1")){
                params.put("begin",weekUtil().get(0));
                params.put("end",weekUtil().get(1));
            }else if(type.equals("2")){
                params.put("begin",dateUtil().get(0));
                params.put("end",dateUtil().get(1));
            }
            map.put("data",cabinetFormDao.findCabinetProductExpendMoneyByMainCabCode(params));
            map.put("sum",cabinetFormDao.findCabinetProductSumMoneyByMainCabCode(params));
            return JsonResult.success("查询成功", map);
        }
        if(StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&StringUtils.isNotBlank(mainCabCode)){
            Map<String, Object> params = new HashMap<>();
            params.put("enterpriseCode",JwtUtils.getEnterpriseCode());
            params.put("mainCabCode",mainCabCode);
            params.put("begin",startTime);
            params.put("end",endTime);
            map.put("data",cabinetFormDao.findCabinetProductExpendMoneyByMainCabCode(params));
            map.put("sum",cabinetFormDao.findCabinetProductSumMoneyByMainCabCode(params));
            return JsonResult.success("查询成功", map);
        }
        return JsonResult.fail();
    }

    @Override
    public Page<CellInventoryInoutVO> queryCabinetList(Page page, Map<String, Object> params,String type) {
        if(StringUtils.isNotBlank(type)){
            if(type.equals("0")){
                params.put("begin",dayUtil().get(0));
                params.put("end",dayUtil().get(1));
            }else if(type.equals("1")){
                params.put("begin",weekUtil().get(0));
                params.put("end",weekUtil().get(1));
            }else if(type.equals("2")){
                params.put("begin",dateUtil().get(0));
                params.put("end",dateUtil().get(1));
            }
        }
        List<CellInventoryInoutVO> list = cabinetFormDao.findCabinetDetail(page, params);
        page.setRecords(list);
        return page;
    }

    @Override
    public JsonResult recycleSixthChart(String type, String dateType, String startTime, String endTime,String brandId, String devCode,String mainCabCode,int businessType) {
        String enterpriseCode = JwtUtils.getEnterpriseCode();
        HashMap map = new HashMap();

        if (businessType == 2){
            map.put("title","报修原因统计");
        }else if (businessType == 3){
            map.put("title","报废原因统计");
        }

        //获取时间
        dateTimeByDateType(dateType);

        /*Long productBrandId;
        if(StringUtils.isBlank(brandId)){
            productBrandId = null;
        }else {
            productBrandId = Long.valueOf(brandId);
        }*/


        if (StringUtils.isNotBlank(type)){
            if(type.equals("0")){
//                map.put("data",cabinetFormDao.findDiscardReason(dayUtil().get(0),dayUtil().get(1),enterpriseCode,productBrandId,devCode,mainCabCode,businessType));
                map.put("data",cabinetFormDao.findDiscardReason2(dayUtil().get(0),dayUtil().get(1),enterpriseCode,mainCabCode,businessType));
                return JsonResult.success("查询成功",map);
            }else if(type.equals("1")){
//                map.put("data",cabinetFormDao.findDiscardReason(startWeekDateTime,endWeekDateTime,enterpriseCode,productBrandId,devCode,mainCabCode,businessType));
                map.put("data",cabinetFormDao.findDiscardReason2(startWeekDateTime,endWeekDateTime,enterpriseCode,mainCabCode,businessType));
                return JsonResult.success("查询成功",map);
            }else if(type.equals("2")){
//                map.put("data",cabinetFormDao.findDiscardReason(startMonthDateTime,endMonthDateTime,enterpriseCode,productBrandId,devCode,mainCabCode,businessType));
                map.put("data",cabinetFormDao.findDiscardReason2(startMonthDateTime,endMonthDateTime,enterpriseCode,mainCabCode,businessType));
                return JsonResult.success("查询成功",map);
            }
        }

        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
//            map.put("data",cabinetFormDao.findDiscardReason(start,end,enterpriseCode,productBrandId,devCode,mainCabCode,businessType));
            map.put("data",cabinetFormDao.findDiscardReason2(start,end,enterpriseCode,mainCabCode,businessType));
            return JsonResult.success("查询成功", map);

        }

        /*if(StringUtils.isNotBlank(type)&&StringUtils.isBlank(brandId)&&StringUtils.isBlank(devCode)&&StringUtils.isBlank(mainCabCode)){
            if(type.equals("0")){
                map.put("data",cabinetFormDao.findDiscardReason(dayUtil().get(0),dayUtil().get(1),enterpriseCode,null,null,null,businessType));
                return JsonResult.success("查询成功",map);
            }else if(type.equals("1")){
                map.put("data",cabinetFormDao.findDiscardReason(weekUtil().get(0),weekUtil().get(1),enterpriseCode,null,null,null,businessType));
                return JsonResult.success("查询成功",map);
            }else if(type.equals("2")){
                map.put("data",cabinetFormDao.findDiscardReason(dateUtil().get(0),dateUtil().get(1),enterpriseCode,null,null,null,businessType));
                return JsonResult.success("查询成功",map);
            }
        }
        if(StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&StringUtils.isBlank(brandId)&&StringUtils.isBlank(devCode)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            map.put("data",cabinetFormDao.findDiscardReason(start,end,enterpriseCode,null,null,null,businessType));
            return JsonResult.success("查询成功", map);
        }
        if(StringUtils.isNotBlank(brandId)&&StringUtils.isNotBlank(type)) {
            Long productBrandId = Long.valueOf(brandId);
            if(type.equals("0")){
                map.put("data",cabinetFormDao.findDiscardReason(dayUtil().get(0),dayUtil().get(1),enterpriseCode,productBrandId,null,null,businessType));
                return JsonResult.success("查询成功",map);
            }else if(type.equals("1")){
                map.put("data",cabinetFormDao.findDiscardReason(weekUtil().get(0),weekUtil().get(1),enterpriseCode,productBrandId,null,null,businessType));
                return JsonResult.success("查询成功",map);
            }else if(type.equals("2")){
                map.put("data",cabinetFormDao.findDiscardReason(dateUtil().get(0),dateUtil().get(1),enterpriseCode,productBrandId,null,null,businessType));
                return JsonResult.success("查询成功",map);
            }
        }
        if(StringUtils.isNotBlank(devCode)&&StringUtils.isNotBlank(type)) {
            if(type.equals("0")){
                map.put("data",cabinetFormDao.findDiscardReason(dayUtil().get(0),dayUtil().get(1),enterpriseCode,null,devCode,null,businessType));
                return JsonResult.success("查询成功",map);
            }else if(type.equals("1")){
                map.put("data",cabinetFormDao.findDiscardReason(weekUtil().get(0),weekUtil().get(1),enterpriseCode,null,devCode,null,businessType));
                return JsonResult.success("查询成功",map);
            }else if(type.equals("2")){
                map.put("data",cabinetFormDao.findDiscardReason(dateUtil().get(0),dateUtil().get(1),enterpriseCode,null,devCode,null,businessType));
                return JsonResult.success("查询成功",map);
            }
        }
        if(StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&StringUtils.isNotBlank(brandId)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            Long productBrandId = Long.valueOf(brandId);
            map.put("data",cabinetFormDao.findDiscardReason(start,end,enterpriseCode,productBrandId,null,null,businessType));
            return JsonResult.success("查询成功", map);
        }
        if(StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)&&StringUtils.isNotBlank(devCode)){
            LocalDateTime start = LocalDateTimeUtils.convertStringToLDT(startTime,"yyyy-MM-dd HH:mm:ss");
            LocalDateTime end = LocalDateTimeUtils.convertStringToLDT(endTime,"yyyy-MM-dd HH:mm:ss");
            map.put("data",cabinetFormDao.findDiscardReason(start,end,enterpriseCode,null,devCode,null,businessType));
            return JsonResult.success("查询成功", map);
        }*/
        return JsonResult.fail();
    }

    @Override
    public JsonResult queryTeleplayBoard(String type) {
        //String enterpriseCode = JwtUtils.getEnterpriseCode();
        HashMap map = new HashMap(){};
        Map<String, Object> params = new HashMap<>();
        if(type.equals("1")){
            params.put("type",type);
        }else {
            params.put("type",3);
        }
        //params.put("enterpriseCode",enterpriseCode);
        params.put("monthStartTime",FindDateStatusUtil.dateUtil().get(0));
        params.put("monthEndTime",FindDateStatusUtil.dateUtil().get(1));
        //领新数量
        map.put("materialNumber",cabinetFormDao.findMaterialNumber(params));
        //报废数量
        map.put("scrapNumber",cabinetFormDao.findScrapNumber(params));
        //在库刀柜数量
        map.put("inCabinetNumber",cabinetFormDao.queryInCabinetNumber(params));
        //维修数量
        map.put("maintainNumber",cabinetFormDao.findMaintainNumber(params));
        //库存警告数
        map.put("stockWarnedNumber",cabinetFormDao.queryStockWarnedNumber(params));
        //盘验任务数
        map.put("surveyTaskNumber",cabinetFormDao.querySurveyTaskNumber(params));
        //今日领新
        map.put("toolWear",cabinetFormDao.queryCutterConsumes(params));
        //今日维修
        map.put("cutterMaintain",cabinetFormDao.queryCutterMaintain(params));
        //今日报废
        map.put("cutterScrap",cabinetFormDao.queryCutterScrap(params));
        //领新排名
        map.put("materialRanking",cabinetFormDao.queryCabinetMiddleNeckRanking(FindDateStatusUtil.dateUtil().get(0),FindDateStatusUtil.dateUtil().get(1),null));
        //暂存排名
        map.put("tempRanking",cabinetFormDao.queryCabinetMiddleTempRanking(FindDateStatusUtil.dateUtil().get(0),FindDateStatusUtil.dateUtil().get(1),null,1));
        //维修排名
        map.put("repairRanking",cabinetFormDao.queryCabinetMiddleTempRanking(FindDateStatusUtil.dateUtil().get(0),FindDateStatusUtil.dateUtil().get(1),null,2));
        //报废排名
        map.put("recycleRanking",cabinetFormDao.queryCabinetMiddleTempRanking(FindDateStatusUtil.dateUtil().get(0),FindDateStatusUtil.dateUtil().get(1),null,3));
        //库存告警
        map.put("stockWarnedList",cabinetFormDao.queryStockWarned(params));

        //领新记录
        map.put("newRecords",cabinetFormDao.queryNewRecords(dayUtil().get(0),dayUtil().get(1)));

        //呆滞告警

        int settingDay = 0;
        int differDay = 0;
        List<CellSluggishMaterials> cellSluggishMaterialsList =  new ArrayList<>();
        Map queryParam=new HashMap();
        List<CellInventoryProductVO> list = cellInventoryProductService.list4app(queryParam);
        for(CellInventoryProductVO item:list){
            ProductDetail productDetail = productDetailService.getOne(new LambdaQueryWrapper<ProductDetail>().eq(ProductDetail::getSkuCode, item.getSkuCode()));
            if(productDetail != null){
                    ProductTypeVO productTypeVO = productTypeService.get4appById(productDetail.getProductTypeId());
                // 优先取设置了呆滞归还时长的
                if(productDetail.getLethargyThreshold()!=null){
                    settingDay = productDetail.getLethargyThreshold();
                    if(StringUtils.isNotBlank(item.getDays())){
                        differDay = Integer.parseInt(item.getDays());
                    }
                    if(differDay > settingDay){
                        CellSluggishMaterials cellSluggishMaterials = new CellSluggishMaterials();
                        cellSluggishMaterials.setSkuCode(item.getSkuCode());
                        cellSluggishMaterials.setExhibitTime(item.getCreateTime());
                        cellSluggishMaterials.setReceiptorTime(item.getUpdateTime());
                        cellSluggishMaterials.setSkuName(item.getSkuName());
                        cellSluggishMaterials.setSkuSpec(item.getSkuSpec());
                        cellSluggishMaterials.setProductBrandName(item.getProductBrandName());
                        cellSluggishMaterials.setQuantity(item.getQuantity());
                        cellSluggishMaterials.setSkuPic(productDetail.getProductPic());
                        cellSluggishMaterials.setProductTypeName(item.getProductTypeName());
                        cellSluggishMaterials.setOldSpecCode(item.getSkuSpecOld());
                        cellSluggishMaterials.setUnitName(item.getUnitName());
                        cellSluggishMaterials.setBasicsUnitName(item.getBasicsUnitName());
                        cellSluggishMaterials.setLethargyThreshold(settingDay);
                        cellSluggishMaterialsList.add(cellSluggishMaterials);
                    }
                }else if(productTypeVO != null && StringUtils.isNotBlank(productTypeVO.getDays())){
                    if(StringUtils.isNotBlank(item.getDays())){
                        settingDay = Integer.parseInt(productTypeVO.getDays());
                        differDay = Integer.parseInt(item.getDays());
                        if(item.getUpdateTime()!=null){
                            if(differDay > settingDay){
                                CellSluggishMaterials cellSluggishMaterials = new CellSluggishMaterials();
                                cellSluggishMaterials.setSkuCode(item.getSkuCode());
                                cellSluggishMaterials.setExhibitTime(item.getCreateTime());
                                cellSluggishMaterials.setReceiptorTime(item.getUpdateTime());
                                cellSluggishMaterials.setSkuName(item.getSkuName());
                                cellSluggishMaterials.setSkuSpec(item.getSkuSpec());
                                cellSluggishMaterials.setProductBrandName(item.getProductBrandName());
                                cellSluggishMaterials.setQuantity(item.getQuantity());
                                cellSluggishMaterials.setSkuPic(productDetail.getProductPic());
                                cellSluggishMaterials.setProductTypeName(item.getProductTypeName());
                                cellSluggishMaterials.setOldSpecCode(item.getSkuSpecOld());
                                cellSluggishMaterials.setUnitName(item.getUnitName());
                                cellSluggishMaterials.setBasicsUnitName(item.getBasicsUnitName());
                                cellSluggishMaterials.setLethargyThreshold(settingDay);
                                cellSluggishMaterialsList.add(cellSluggishMaterials);
                            }
                        }else {
                            String creatTime = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(item.getCreateTime());
                            String todayTime = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(LocalDateTime.now());
                            if(FindDateStatusUtil.daysBetween(creatTime,todayTime) > settingDay){
                                CellSluggishMaterials cellSluggishMaterials = new CellSluggishMaterials();
                                cellSluggishMaterials.setSkuCode(item.getSkuCode());
                                cellSluggishMaterials.setSkuName(item.getSkuName());
                                cellSluggishMaterials.setSkuSpec(item.getSkuSpec());
                                cellSluggishMaterials.setProductBrandName(item.getProductBrandName());
                                cellSluggishMaterials.setExhibitTime(item.getCreateTime());
                                cellSluggishMaterials.setReceiptorTime(item.getUpdateTime());
                                cellSluggishMaterials.setQuantity(item.getQuantity());
                                cellSluggishMaterials.setSkuPic(productDetail.getProductPic());
                                cellSluggishMaterials.setProductTypeName(item.getProductTypeName());
                                cellSluggishMaterials.setOldSpecCode(item.getSkuSpecOld());
                                cellSluggishMaterials.setUnitName(item.getUnitName());
                                cellSluggishMaterials.setBasicsUnitName(item.getBasicsUnitName());
                                cellSluggishMaterials.setLethargyThreshold(settingDay);
                                cellSluggishMaterialsList.add(cellSluggishMaterials);
                            }

                        }
                    }
                }
            }
        }


        map.put("slackAlarm",cellSluggishMaterialsList);

        return JsonResult.success("查询成功", map);
    }


}
